# Integrating functions with dependent variable inside

dy/dx = k(L-y) where k and L are constants y(0)= 0

How does one find the integral for this and whats the reasoning please?

-
this looks like a differential equation to me –  user31280 Oct 21 '12 at 11:04
This has been answered many times on this site already... –  Hans Lundmark Oct 21 '12 at 11:08
$dy/dx=f(x)g(y)$ gives $dy/g(y) = f(x)dx$ if $g(y)\ne 0$. –  FrenzY DT. Oct 21 '12 at 11:13
See here, for a similar example: math.stackexchange.com/a/43176/1242 –  Hans Lundmark Oct 21 '12 at 11:14

This is a differential equation $y' = kL - ky$ with homogeneous equation $y_h' = - ky_h$ and particular equation $y_p = c(x)y_h$ and $y = y_h + y_p$

$y_h$ is obviously $k_1e^{-kx}$, $k_1$ another constant, the problem lies in finding $y_p$.

$y_p = c(x)y_h = c_1(x)e^{-kx}$ and $y_p' = c_1'(x)e^{-kx} - kc_1(x)e^{-kx}$ which is of the form $y_p' = c_1'(x)e^{-kx} - ky_p$, same with the initial problem. We then have $c_1'(x)e^{-kx} = kL$ and $\displaystyle c_1(x) = \int_{0}^{x} \cfrac{kL}{e^{-kt}}dt = kL \int_{0}^{x} e^{kt}dt= kL\left(\cfrac{e^kx}k-1\right)$ and $y_p = L-kLe^{-kx}$.

Thus, $y=y_h+y_p=k_1e^{-kx}+ L-kLe^{-kx}$, with $y(0) = 0$ one find $k_1= kL-L$ and finally $y = L(1-e^{-kx})$

-
Thank you, finally got it! –  John Oct 23 '12 at 8:54
if you divide both by $(L-Y)$ and multiple by $dx$,you get $\int(dy/(L-Y))=kdx$
or -$ln(L-y)=k*x+c$, multiply it by $-1$, you get $ln(L-Y)=-k*x-c$; now exponential it and you will be fine