On 03/12/2012 10:54 AM, Matthew Rocklin wrote:
Does this help?

In [1]: expr = sin(x)**2

In [2]: p = Wild("p")

In [3]: expr.match(p**2)
Out[3]: {p: sin(x)}


On Mon, Mar 12, 2012 at 7:30 AM, Alan Bromborsky <abro...@verizon.net <mailto:abro...@verizon.net>> wrote:

    On 03/12/2012 10:25 AM, Alan Bromborsky wrote:

        Can assumptions handle the following case -

        I have the expression sin(th)**2 and know that sin(th)**2 > 0
        and I want sqrt( sin(th)**2) = sin(th).

    Failing the use of assumptions is there a way of telling if an
    expression is the square of another expression and what that
    expression is?


-- You received this message because you are subscribed to the Google
    Groups "sympy" group.
    To post to this group, send email to sympy@googlegroups.com
    <mailto:sympy@googlegroups.com>.
    To unsubscribe from this group, send email to
    sympy+unsubscr...@googlegroups.com
    <mailto:sympy%2bunsubscr...@googlegroups.com>.
    For more options, visit this group at
    http://groups.google.com/group/sympy?hl=en.


--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
Thanks much.  That does the trick even for r**2*sin(th)**2.

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to