Given: $\int f(x)\sin x \cos x dx = \log(f(x)){1\over 2( b^2 - a^2)}+C$, find $f(x)$. 
$$\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.

On differentiating you get indeed
$$
f(x)\sin x\cos x=\frac{f'(x)}{f(x)}\frac{1}{2(b^2-a^2)}
$$
so the differential equation
$$
\frac{f'(x)}{f(x)^2}=(b^2-a^2)\sin2x
$$
Integrating it you get
$$
-\frac{1}{f(x)}=-\frac{1}{2}(b^2-a^2)\cos2x+c
$$
hence
$$
f(x)=\frac{2}{(b^2-a^2)\cos2x-2c}
$$
You can expand $\cos2x=\cos^2x-\sin^2x$ and $2c=2c\cos^2x+2c\sin^2x$, so
$$
(b^2-a^2)\cos2x-2c=
(b^2-a^2-2c)\cos^2x+(a^2-b^2-2c)\sin^2x
$$
We can try for
$$
\begin{cases}
a^2-b^2-2c=2a^2 \\[4px]
b^2-a^2-2c=2b^2
\end{cases}
$$
which is valid for $-2c=a^2+b^2$, but I see no reason for choosing this particular solution. The only limitation is that
$$
(b^2-a^2)\cos2x-2c>0
$$
as far as I can see.
Is there any other condition in your problem?
