$$\int f(x)\sin x \cos x dx = \log(f(x)){1\over 2( b^2 - a^2)}+C$$
On differentiating, I get,
$$f(x)\sin x\cos x = {f^\prime(x)\over f(x)}{1\over 2( b^2 - a^2)}$$
$$\sin 2x (b^2 - a^2) = {f^\prime( x)\over (f(x))^2} $$
On integrating,
$${-1\over f(x)} = {-(b^2 - a^2)\cos 2x\over 2} \implies f(x) = { 2\over(b^2 - a^2)\cos 2x}$$
The answer given is $\displaystyle f(x) = {1\over a^2 \sin^2 x + b^2 \cos^2 x}$.
I am unable to get the given result, the closest I got is, $$f(x) = {2\over b^2 \cos^2x -b^2\sin^2 x- a^2\cos^2x+ a^2\sin^2 x}$$.
How to simplify further to get the given answer ?
Related but not duplicate.