# Solving differential equation

Suppose that $y(x) = f (x)$ satisﬁes the differential equation $\frac{dy}{dx} + \frac{y}{x + 1} = y$, and also satisﬁes the intitial condition $y(0) = 5$. What is the value $y(3)$?

I keep did integration with respect to $x$, and keep getting the answer $y(3) = \frac{5}{\ln 4-2}$, but the correct answer is $y(3) = \frac{5e^3}{4}$. Anyone knows how to convert the $\ln$ to $e$?

-
In your equation "dx + x + 1 = y", what do you mean by "dx"? Do you mean $\frac{dx}{dt}$ or something else? –  Rory Daulton Aug 9 at 18:31
Sorry, my bad, I've edited it to reflect the correct equation! –  inggumnator Aug 9 at 18:35
Do you mean $\displaystyle y'(x)+\frac{y(x)}{x+1}=y(x)$? –  agha Aug 9 at 18:36
Yep that would be another way of putting it. –  inggumnator Aug 9 at 18:38
Have you tried solving your ODE by separation of variables? –  paw88789 Aug 9 at 18:41

## HINT

\begin{align} \frac{dy}{dx} + \frac{y}{x + 1} &= y \\ \frac{dy}{dx} + y \left( \dfrac{1}{x + 1} - 1 \right) &= 0 \\ \implies \text{Integrating factor, } I.F. = e^{\int{\frac{-x}{x + 1}dx}} &= e^{-\int{\left( \frac{1}{t} - 1 \right) dt}} \\ &= e^{-(\ln{t} - t)} \\ &= \dfrac{1}{t} \cdot e^t \end{align}

Find $y(x)$ using the above integrating factor.

-
Omg I get it now, thanks!! –  inggumnator Aug 9 at 18:51

$$\frac{dy}{dx}+\frac{y}{1+x}=y$$

First divide both sides by $y$, you get:

$$\frac{y'}{y}=1-\frac{1}{x+1}$$

Now integrate both sides respect to $t$ from 0 to $x$, you have:

1. Left side: integration by substitution.$$\int_0^x \frac{y'(t)}{y(t)}dt=\int_{y(0)}^{y(x)}\frac{1}{t}dt=\ln(|y(x)|)-\ln(|y(0)|)=ln(|y(x)|)-\ln5$$

2.Right side $$\int_{0}^{x}1-\frac{1}{t+1}dt=x-\ln|x+1|+\ln|1|=x-\ln|x+1|$$

So:

$$x-\ln|x+1|=\ln|y(x)|-\ln 5$$

Now you can simply substitute $x=3$, you have:

$$3-\ln 4=\ln(y(3))-\ln(5)$$

Direct from this equation: $y(3)=\frac{5e^3}{4}$.

-
Sorry I don't understand why do you need to do a definite integral? –  inggumnator Aug 9 at 19:03
You can use indefinite if you want, you get something like $\ln y(x)=x+C$ and you get $C$ from initial value. –  agha Aug 9 at 19:08