Let y = sinx + ztanx,where z is a function of x. If (dy/dx)= z+ cosx, show that (d^2y/dx^2) =-y.

I really have no idea how to do this. Please show me

2 answers

dy/dx=cos x+ z sec^2 x+ dz/dx tan x
= z + cos x
so
z = z sec^2 x + dz/dx tan x
z(1-sec^2x) = dz/dx tan x
z (-sin^2x/cos^2x) = dz/dx (sin x/cos x)
z(-tan x ) = dz/dx
dz/dx = -z tan x
-------------------------

d/dx(z+cos x)=d^2y/dx^2=dz/dx-sin x

= -z tan x-sin x
which lo and behold is -y
I may look easy but it took me a while :)