# Solving Differential equation with partial fraction decomposition

I am a little rusty with some calculus and need some help with the follow equation:

$$\int\dfrac{f'(x)}{f(x)}dx = \int\dfrac{1}{-x+x^2y}dx$$

Where $y$ is a constant. My idea is to use some kind of $U$ substitution as I know $\int\frac{dv}{v} = \ln(v)$. This gives:

\begin{align} \ln(f(x)) =& \int\dfrac{1}{-x+x^2y}dx \\ \end{align}

Then I see to solve for $f(x)$ I can exponentiate. To solve the right integrand I would first do partial fraction decomposition which gives: $A=-1$ and $B=y$. Then I have:

\begin{align} \ln(f(x)) = \int\dfrac{-1}{x}dx + \int\dfrac{y}{-1+xy}dx \\ \end{align}

Then I get:

$$f(x) = x+-1+xy = -1+(y+1)x$$

Is this correct?

• What is your initial differential equation? – Cameron Williams Jul 2 '13 at 2:20
• Need a constant of integration. And little mistake at the end, with your calculation (no constant of integration) you should I think get $(-1+xy)/x$. – André Nicolas Jul 2 '13 at 2:22

Everything you've done looks correct, except from the second-to-last to the last lines. After the integration you get: $$\ln(f(x)) = -\ln(x) + \ln(-1+xy) + C$$ (Don't forget the +C)
Exponentiating both sides, we get ($\exp(x)$ is shorthand for $e^x$): \begin{align} f(x) &= \exp(-\ln(x) + \ln(-1+xy) + C)\\ &=\exp(-\ln(x))\cdot\exp(\ln(-1+xy))\cdot\exp(C)\\ &=\left(\frac{1}{x}\right)\left(xy-1\right)\cdot(C)\\ &=\left(y - \frac{1}{x}\right)\cdot C \end{align}
Note that $\exp(a+b)\ne\exp(a)+\exp(b)$.
To show that this satisfies the original equation: $$\frac{d f}{dx} = \frac{C}{x^2}$$
\begin{align} \frac{f'(x)}{f(x)} &= \frac{\frac{C}{x^2}}{\left(y - \frac{1}{x}\right)\cdot C}\\ &=\frac{1}{x^2\left(y - \frac{1}{x}\right)}\\ &=\frac{1}{x^2y-x} \end{align}
Thus: $$\int\frac{f'(x)}{f(x)}\,dx = \int\frac{1}{x^2y-x}\,dx$$