Initial Value Problem $\tan(x)y′+y=1$ Find the solution for the initial value problem $y(π/2)=0$.
$tan(x)y′+y=1$
I know the general solution is $y=1+\frac{C}{sin(x)}$
and for the IVP $y=1-\frac{1}{sin(x)}$.
I've tried two methods so far and gotten nowhere on the problem.  I first tried moving everything over to the right side but $y'$ and then trying to integrate them.  I got stuck at trying to do the integral of $dy=\frac{1-y}{tan(x)}$.  I then tried to use the integrating factor, but the equation doesn't seem right for doing so.  What's the best way to go about this problem?
I'm also confused by the answer to the IVP - I suspect I'm doing something wrong.  I know $sin(\frac{π}{2})$ is $1$, so why is it $y=1-\frac{1}{sin(x)}$ instead of $y=1+\frac{1}{sin(x)}$ (why is the negative there?)
Thanks for the help.
 A: Your differential equation only makes sense in the interval $-{\pi\over2}<x<{\pi\over2}$ and its translates by integer multiples of $\pi$, since $\tan x$ is not defined at odd multiples of ${\pi\over2}$. Given such an interval $I$  an additional obstacle will show up: As $\cos x\ne0$ in $I$ your differential equation is equivalent with
$$y'\ \sin x+y\ \cos x-\cos x=0\qquad(x\in I)\ ,$$
which is the same as
$$\bigl((y-1)\ \sin x\bigr)'=0\qquad(x\in I)\ .$$
It follows that there is a constant $C\in{\mathbb R}$ such that $(y-1)\sin x=C$. As $\sin x=0$ for the midpoint of $I$ the only solution that is defined in all of $I$ is the function resulting from $C=0$, i.e., the constant function $y(x)\equiv1$. There are further solutions which are defined only in the left  or the right half  of $I$, given by
$$y(x)={C\over \sin x}+1$$
with an arbitrary $C$. It is possible to concatenate two such solutions over an odd multiple $\xi$ of ${\pi\over2}$, but at the point $\xi$ the given differential equation makes no sense.
A: Do you see that it is separable and we can then use integration to write:
$$\displaystyle \int \frac{dy}{1-y} = \int \cot x dx$$
These integrals yield:
$$-\ln(-y + 1) = \ln(\sin x) + c$$
We want to isolate $y(x)$.
Taking exponentials of each side yields:
$$-y + 1 = e^{-\ln(\sin(x)-c} = \dfrac{c}{\sin x} = c ~ \csc x$$
This reduces to:
$$y(x) = c ~ \csc x +1$$
A: Hint: Note that
$$\tan(x)\cdot y'+y=\frac{\sin(x)\cdot y'+\cos(x)\cdot y}{\cos x}=\frac{\sin(x)\cdot y'+(\sin(x))'\cdot y}{\cos x}=\frac{(\sin(x)\cdot y)'}{\cos x}$$
hence one is trying to solve
$$
(\sin(x)\cdot y)'=\cos(x)=(\sin(x))'.
$$
You might want to finish this...
A: You cannot define the initial condition like that because $\tan x$ is not defined at $x=\pi/2$. With that form it is meaningless to talk about existence of the solution to the given IVP. Actually even you find the general solution of the equation you will see that constant $C$ appearing in the solution is not determined by using the initial condition. 
