I'm a beginner in using Matlab. if I have a DE like
$$x'(t)=\frac{1}{\sin (2x)}$$
How I can Implement in Matlab to calculate just answer?
I try dsolve like as:
ySol(t) = dsolve(ode,cond) but couldn't define ode, and cond.
and different answer from Wolfram:



These are the same answer. Separate to get
$$ \sin(2x) dx = dt $$
There are two ways to do this. The first is to integrate directly:
$$ -\frac12\cos(2x) = t + c_1 $$ $$ \cos(2x) = -2(t+c_1) $$ $$ x = \frac12 \arccos(-2(t+c_1)) $$
This is the answer given by Wolfram.
The second way is to use the double-angle formula
$$ 2\sin(x)\cos(x) dx = dt $$
$$ \sin^2(x) = t + c_2 $$
$$ \sin (x) = \sqrt{t+c_2} $$
$$ x = \arcsin(\sqrt{t+c_2}) $$
This is the answer given by MATLAB.
If you're wondering why there two different anti-derivatives of $\sin(2x)$, it's because they differ by a constant
$$ \sin^2 x = -\frac12\cos (2x) + \frac12 $$