Integrating $\int{\frac{x\,dx}{x^2 + 3x -4}}$ I saw this "Beat the Integral" problem and wanted to be sure I was approaching it correctly.
The integral is $$\int{\frac{x}{x^2 + 3x -4}dx}$$
So I decide I want to decompose this, because it's a degree-2 polynomial in the denominator and a degree-1 in the numerator, so that'd be a go-to. Also, since the degree of th enumerator is one less than the denominator we can maybe treat this as $du/u$ which would imply a natural log, though we don't quite know that yet.
So we decompose: I know that $x^2+3x-4$ can be factored as $(x-1)(x+4)$.
That gets me
$$\int{\frac{x}{(x-1)(x+4)}dx}$$
so I can do this:
$$\frac{Ax}{x-1}+\frac{B}{x+4} = \frac{x}{(x-1)(x+4)}$$
Which implies
$$A(x+4)+B(x-1) = x$$
and since the roots are at $x=1$ and $x=-4$, I can set it up like this:
$$5A = 1;-5B=1 \text{  and } A = \frac{1}{5}, B=-\frac{1}{5}$$
Leading to:
$$\frac{x}{5(x-1)}-\frac{1}{5(x+4)}$$
Which I can set up the integral like so:
$$\int{\frac{x}{5(x-1)}-\frac{1}{5(x+4)}dx}=\int{\frac{x}{5(x-1)}dx-\int{\frac{1}{5(x+4)}dx}}$$
I can now integrate by addition here  $$\int{\frac{x}{x-1}}dx=\int{\frac{x-1+1}{x-1}}dx=x+\int{\frac{1}{x-1}}dx=x-\ln(x-1)$$
And doing the same thing for the second term and bringing back my $\frac{1}{5}$
$$\frac{1}{5}(x-\ln(x-1)+\ln(x+4))$$
I suspect there is a further simplification I could do. On a problem like this I also saw it integrated as an arctangent, but that seemed needlessly complex? In any case I was curious if I did this correctly.
 A: HINT
Here it is an alternative way to solve it:
\begin{align*}
\frac{x}{(x-1)(x+4)} & = \frac{(x-1) + 1}{(x-1)(x+4)}\\\\
& = \frac{1}{x+4} + \frac{1}{(x-1)(x+4)}\\\\
& = \frac{1}{x+4} + \frac{1}{5}\times\frac{(x+4) - (x-1)}{(x-1)(x+4)}\\\\
& = \frac{1}{x+4} + \frac{1}{5}\times\left[\frac{1}{x-1} - \frac{1}{x+4}\right]\\\\
& = \frac{1}{5(x-1)} + \frac{4}{5(x+4)}
\end{align*}
Can you take it from here?
A: Since the denominator has two linear factors, you can set up your partial fraction decomposition as
$$\frac{x}{(x+4)(x-1)} = \frac{A}{x+4} + \frac{B}{x-1}$$
This implies
$$ x = A(x-1) + B(x+4) $$
So $A+B=1$ and $4B-A=0$ $\Rightarrow$ $(A,B) = (\frac{4}{5},\frac{1}{5})$.
This means that
$$\int \frac{x}{(x-4)(x+1)} dx = \frac{1}{5} \int \frac{4}{x+4} + \frac{1}{x-1}dx $$
Then you can continue from here.
This is my first response, so I would very much appreciate any feedback on formatting or other site etiquette I may be unaware of. I hope this helps!
A: Its wrong ! the step $$A(x+4)+B(x-1) = x$$ is not true instead you should have $$Ax(x+4)+B(x-1)=x$$ As you can see we would then have to take $A=0$ and the purpose of partial fractions is gone
I prefer $$\frac{x}{x^2-3x+4}=\frac{1}{5}(\frac{1}{x-1})+\frac{4}{5}(\frac{1}{x+4})$$
another way is to write $x=l(2x-3)+m$ (because derivative of $x^2-3x+4=2x-3$) then we have $$\int \frac{x}{x^2-3x+4}=\int \frac{2x-3}{2(x^2-3x+4)}+\int \frac{3}{2(x^2-3x+4)}$$ which is easy
A: $$I=\int\frac{x}{x^2+3x+4}dx=\frac12\int\frac{2x+3}{x^2+3x+4}-\frac{3}{x^2+3x+4}$$
$$I=\frac12\ln|x^2+3x+4|-\frac32\int\frac{1}{(x+3/2)^2+7/4}dx$$
then you can let $u=x+3/2,\,du=dx$ so you have $u^2+(\sqrt{7}/2)^2=\frac74\left((2u/\sqrt{7})^2+1\right)$ now let $v=2u/\sqrt{7},\,dv=2/\sqrt{7}du$ now you have an integral of the form:
$$\int\frac{1}{v^2+1}dv$$ which can be easily solved using the substitution $v=\tan(t)$
A: The decomposition into partial fractions supposes   these are proper rational fractions, where the degree of the numerator is less than the degree of the irreducible factor in the denominator. When the given fraction has only simple poles, as is the case here, this means the numerator is a constant, and actually, there exists a formula for a simple pole $\alpha$ of the rational function $\frac{P(x)}{Q(x)}$: the coefficient $A_\alpha$ for the pole $\alpha$ is given by
$$A_\alpha=\frac{P(\alpha)}{Q'(\alpha)},$$
which leads to the decomposition
$$\frac x{x^2+3x-4}=\frac x{(x-1)(x+4)}=\frac 15\frac1{x-1}+\frac 45\frac1{x+4}$$
and the integral
$$\frac15\bigl(\ln|x-1|+4\ln|x+4|\bigr)+C=\frac15\ln\bigl(|x-1|(x+4)^4\bigr)+C.$$
A: $$\int{\frac{xdx}{x^2 + 3x -4}}=\frac{1}{2}(\int{\frac{(2x+3)dx}{x^2 + 3x -4}}-3\int{\frac{dx}{x^2 + 3x -4}})=\frac{1}{2}(\int{\frac{(2x+3)dx}{x^2 + 3x -4}}+\frac{3}{5}(\int{\frac{dx}{x +4}}-\int{\frac{dx}{x -1}}))=\frac{1}{2}\ln{|x^2+3x-4|}+\frac{3}{5}\ln{|x+4|} -\frac{3}{5}\ln{|x-1|}+C=\frac{1}{2}\ln{|x+4|}+\frac{1}{2}\ln{|x-1|}+\frac{3}{10}\ln{|x+4|} -\frac{3}{10}\ln{|x-1|}+C=\frac{4}{5}\ln|x+4|+\frac{1}{5}\ln|x-1|+C$$
