Trigonometric Integral $\int _0^{\pi/4}\:\frac{dx}{\cos^4x-\cos^2x\sin^2x+\sin^4x}$ Q. $$\int _0^{\pi/4}\:\frac{1}{\cos^4x-\cos^2x\sin^2x+\sin^4x}$$
My method:
$$\int_0^{ \pi /4} \frac{dx}{(\cos^2x+\sin^2x)^2-3\cos^2x \sin^2x}=\int_0^{ \pi /4} \frac{dx}{1-3\cos^2x\sin^2x} $$
Dividing numerator and denominator by $\cos^2x$ we have:
$$\int_0^{\pi /4}\frac{\sec^2x}{\sec^2x-3\tan^2x}dx=\int_0^{\pi /4}\frac{\sec^2x}{1-2\tan^2x}dx=\int _0^1 \frac{dt}{1-2t^2}=\int _0^1 \frac{1}{2}\frac{dt}{\frac{1}{2}-t^2}=\frac{1}{2\sqrt{2}}\log\left|\frac{1-\sqrt{2}t}{1+\sqrt{2}t}\right|_0^1=\frac{1}{2\sqrt{2}}\log\left|\frac{1-\sqrt{2}}{1+\sqrt{2}}\right|$$
But when we do the same integration by dividing the initial term by $\sec^4x$ and solving it yields an answer $$\frac{\pi }{2}$$
Am I wrong somewhere?

Multiplying both numerator and denominator by $\sec^4x$ yields
$$
\begin{aligned}
& \int_{0}^{\frac{\pi}{4}} \frac{d x}{1-3 \cos ^{2} x \sin ^{2} x} \\
=& \int_{0}^{\frac{\pi}{4}} \frac{\sec ^{4} x}{\sec ^{4} x-3 \tan ^{2} x} d x  \\
=& \int_{0}^{1} \frac{1+t^{2}}{\left(1+t^{2}\right)^{2}-3 t^{2}} d t \quad \textrm{ where }t=\tan x \\
=& \int_{0}^{1} \frac{1+t^{2}}{t^{4}-t^{2}+1} d t \\
=& \int_{0}^{1} \frac{1+\frac{1}{t^{2}}}{t^{2}+\frac{1}{t^{2}}-1} d t \\
=& \int_{0}^{1} \frac{d\left(t-\frac{1}{t}\right)}{\left(t-\frac{1}{t}\right)^{2}+1}\\=&\left[\tan ^{-1}\left(t-\frac{1}{t}\right)\right]_{0}^{1}\\=&\frac{\pi}{2}
\end{aligned}
$$
