I have been trying to simplify
exp(2*I*N) - 1)**2/((exp(2*I*N) - 1)**2 - 4*exp(2*I*N)*cos(N)**2)
Where the answer should be (sin N)^2, but the output is same as input.
I have tried .rewrite(cos) and then simplify, trigsimp, expand and pretty much all I could discover quickly from help sources.
Rewriting in terms of exp instead of cos is more helpful:
expr.rewrite(exp).simplify()
returns -cos(2*N)/2 + 1/2 which is visibly equivalent to sin(N)**2. Clean it up with
expr.rewrite(exp).simplify().trigsimp()
getting sin(N)**2
Old answer, might still be of value: You probably meant N to be real, so let's declare it as such.
Given a mix of complex exponentials and trigonometric functions, it will probably help to separate the real and imaginary parts with as_real_imag(). A direct application does not do much beyond putting re(...) and im(...), so rewriting in exponentials and expanding the squares/products is advisable first:
N = symbols('N', real=True)
expr = (exp(2*I*N) - 1)**2/((exp(2*I*N) - 1)**2 - 4*exp(2*I*N)*cos(N)**2)
result = [a.trigsimp() for a in expr.rewrite(cos).expand().as_real_imag()]
Result: [sin(N)**2, 0], meaning the real and imaginary parts of the expression. It can be recombined into a single expression with result[0] + I*result[1].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With