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 <[email protected] <mailto:[email protected]>> 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 [email protected]
    <mailto:[email protected]>.
    To unsubscribe from this group, send email to
    [email protected]
    <mailto:sympy%[email protected]>.
    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 [email protected].
To unsubscribe from this group, send email to [email protected]. 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to