<s>[INST] Find tangent to trigonometric function I want to find the tangent to the curve: 
$x\sin{y} + y\sin{x} = \frac{\pi}{4}(1+\sqrt{2})$
through the point $(\frac{\pi}{2}, \frac{\pi}{4})$
Now I know I can fill certain information into this formula
$y-y_0 = a(x-x_0)$ to get a tangent, but I dont really know how to find 
$a$ in this situation. How can I find the derivate here when I cant isolate $y$ on one side (that im aware of) ?
I tried to make an expression on the form $\sin(x+\theta) = \text{something}$ but without success
Thanks in advance for any help or hints
 [/INST] We will use implicit differentiation in this problem to extract $\frac{dy}{dx}$:
$$
x\sin{y}+y\sin{x}=\frac{\pi}{4}(1+\sqrt{2})\\
\cos{y}+x\frac{dy}{dx}\cos{y}+\frac{dy}{dx}\sin{x}+y\cos{x}=0\\
\frac{dy}{dx}(x\cos{y}+\sin{x})=-(\sin{y}+y\cos{x})\\
\frac{dy}{dx}=-\frac{\sin{y}+y\cos{x}}{x\cos{y}+\sin{x}}
$$
And for $x=\frac{\pi}{2}\quad y=\frac{\pi}{4}$ you get:
$$
a={\frac{dy}{dx}}_{(x,y)=(\frac{\pi}{2},\frac{\pi}{4})}=-\frac{2\sqrt{2}}{4+\pi\sqrt{2}}
$$
So the equation of the tangent becomes:
$$
y=-\frac{2\sqrt{2}}{4+\pi\sqrt{2}}x+C
$$
Since this is a tangent line it will pass from $(\frac{\pi}{2},\frac{\pi}{4})$:
$$
\frac{\pi}{4}=-\frac{2\sqrt{2}}{4+\pi\sqrt{2}}\frac{\pi}{2}+C\\
C=\frac{\pi}{4}+\frac{\pi\sqrt{2}}{4+\pi\sqrt{2}}
$$ 
And we finally get:
$$
y=-\frac{2\sqrt{2}}{4+\pi\sqrt{2}}x+\frac{\pi}{4}+\frac{\sqrt{2}\pi}{4+\sqrt{2} \pi}
$$
</s>