The original claim $x^2+(1+x^2)\sin\theta=1$ is false. When $\sin(\theta)=-1$, and $\cos(\theta)=0$ (say at $\theta=-\pi/2$), then for any $x$, we have $x\cos(\theta)-\sin\theta=1$ but
$$
x^2+(1+x^2)\sin\theta=x^2-(1+x^2)=-1\neq 1.
$$
Edit for the updated question: The case $\cos\theta=0$ gives us $\sin(\theta)=-1$ and so
$$
x^2+(1+x^2)\sin\theta=-1.
$$
When $\cos\theta\neq 0$, we have $x\cos\theta-\sin\theta=1\implies x=\frac{1+\sin\theta}{\cos\theta}$ and so
$$
x^2=\frac{1+2\sin\theta+\sin^2\theta}{\cos^2\theta},\quad 1+x^2=\frac{2+2\sin\theta}{\cos^2\theta}
$$
which implies
$$
x^2+(1+x^2)\sin\theta=\frac{1+2\sin\theta+\sin^2\theta+(2\sin\theta+2\sin^2\theta)}{\cos^2\theta}=\frac{2(1+2\sin\theta+\sin^2\theta)+\sin^2\theta-1}{\cos^2\theta}=-1+2x^2.
$$
This means your expression is in general not identically equal to any constant.
$f(\theta) = 4 - \sqrt{10}$ is correct.
so what is the error here:
$f(\theta) = 3(\sin \theta-\cos\theta)^2 + 2\sin^2\theta$
That part is a true statement but then you say.
Hence the minimum value of $f(θ)=2\sin^2θ,$ when $θ=π/4$ hence minimum value of $f(θ)=1.$
It is a logical jump that was a step too far.
If you had had,
$f(\theta) = 3(\sin \theta-\cos\theta)^2 + k$
it would be okay to zero out the term in parentheses. It must be greater than or equal to zero, so set it to zero.
But in your actual expression
$f(\theta) = 3(\sin \theta-\cos\theta)^2 + 2\sin^2\theta$
Minimizing either term doesn't minimize the sum.
Furthermore, when you say the minimum of $f(θ)=2\sin^2θ,$ occurs when $θ=\pi/4$ that is just wrong.
Best Answer
$$d=a\sin x+2b\cos\theta\cos x=\sqrt{a^2+(2b\cos\theta)^2}\sin\left(x+\arcsin\dfrac{2b\cos\theta}{\sqrt{a^2+(2b\cos\theta)^2}}\right)$$
As for real $y,\sin y\le1$
$$\implies d\le\sqrt{a^2+(2b\cos\theta)^2}$$
Can you square both sides & rearrange?