Question: Assuming in differential equation

I'm trying to solve

deq := diff(theta(x), x) = -sin(theta(x));
                         
sol := dsolve({deq, theta(0) = -(1/2)*Pi});
 

The answer should be theta=-2*arctan(exp(-x))

but I get

theta(x) = arctan(2*exp(-x+I*Pi)/((exp(-x+I*Pi))^2+1), -((exp(-x+I*Pi))^2-1)/((exp(-x+I*Pi))^2+1))

Does it have to do with assuming?

Staffan Malmberg

 

Please Wait...