Need directions to solve this ODE : $\frac{dy}{dx} +\tan{y}=\frac{x}{\cos{y}}$

Actually, it is supposed to be First Order Ordinary Linear DE. I was not able to make it really linear with all my transformations. I was given a clue that I need to make substitution $z=\sin{y}$, I think it should lead to linear equation relative to $\sin{y}$. But I stuck at the very begining of substitution, how should I make it for $y$, to dissappear?

$$y'\cos y + \sin y = x$$ note that $$\dfrac{d}{dx}\sin y = y' \cos y$$ use a change of variables.
• It is something you see after years of being taught and then teaching. Though, given the hint (which i did not see on first glance of post) you ought to play around with the derivatives by inserting in the $z = \sin y$ and see what you got (like the other answer on here) :) – Chinny84 Aug 5 '15 at 16:11
• Correct. However, he has to be aware that multiplying by $cos(y)$ he may have multiplied by zero... So one has to be careful when establishing the interval where $y$ (as a solution) is defined, since it may be much shorter than the one you would get simply solving the equation after the multiplication by $cos(y)$... – bartgol Aug 5 '15 at 19:33
$$z=\sin(y) \implies \frac{dz}{dx}=\cos(y) \cdot \frac{dy}{dx}$$
$$\cos(y) \cdot \frac{dy}{dx} + \sin(y) = \frac{dz}{dx} + z = x$$