<s>[INST] In checking whether $\tan^{-1}(2\sin^2x-1)+C$ agrees with $\tan^{-1}(\tan^2x)+C$, why am I getting $\sin^{2} 2x = 2$? So this began with the integral-
$$\int \frac{\sin 2x}{\sin^4x + \cos^4x}dx$$
The integral is simple, I solved it as following-
$$\int \frac{\sin 2x}{\sin^4x + \cos^4x}dx=\int \frac{2\sin x\cos x}{\sin^4x + (1-\sin^2x)^2}dx$$
Put $\sin^2 x=t$
$2\sin x\cos x\ dx = dt$
$$\int \frac{dt}{t^2+(1-t)^2}=\frac{1}{2}\int \frac{dt}{(t-\frac{1}{2})^2 + (\frac{1}{2})^2}$$
Now put
$t-1/2 = m$
$dt=dm$
$$\frac{1}{2}\int \frac{dm}{m^2 + (\frac{1}{2})^2}$$
Which by standard formula is equal to
$$\frac{1}{2}\left( \frac{1}{\frac{1}{2}}tan^{-1}\frac{m}{\frac{1}{2}}\right)+C=tan^{-1}(2t-1)+C=tan^{-1}(2\sin^2 x-1)+C$$
Now the answer according to my worksheet and this page the answer is $tan^{-1}(\tan ^2 x)+C$
Now my answer clearly doesn't match with the given answer so I check whether these two are equal or not-
$2\sin^2 x-1=tan^2 x$
$2\sin^2 x=1+tan^2 x$
$2\sin^ 2 x=\sec^2 x$
$2\sin^ 2 x=\frac{1}{\cos^2 x}$
$2\sin^ 2 x \cos^2 x=1$
$4\sin^ 2 x \cos^2 x=2$
$\sin^2 2x=2$
This is impossible and I know I have done something wrong but I cross checked it every time but couldn't find the error. Kindly help me out.
EDIT-The standard formula I used above-
$$\int \frac{dx}{x^2+a^2}=\frac{1}{a}\tan^{-1}\left(\frac{x}{a}\right)+C$$
 [/INST] Using
$$\tan(A-B) = \frac{\tan A - \tan B}{1+\tan A \tan B}$$
we have that
$$\tan\left(\tan^{-1}(\tan^2 x) - \tan^{-1}\left(2\sin^2 x - 1\right)\right) = 1$$
So the two solutions are off by a $\frac{\pi}{4}$
</s>