Solving Integration by Parts Problem

  • Thread starter Thread starter squarks
  • Start date Start date
  • Tags Tags
    Integration
squarks
Messages
16
Reaction score
0
Hi. I'm trying to do a simple integration, but I cannot seem to get it. Please help!

Homework Statement


\int\frac{xdx}{\left(x-a\right)^2}

Homework Equations


I'm simply using integration by part using:
\int udv = uv - \int vdu
with:
u=x \rightarrow du=dx
dv=\frac{dx}{\left(x-a\right)^2} \rightarrow v=-\frac{1}{\left(x-a\right)}

The Attempt at a Solution


Just working it out:
\int\frac{xdx}{\left(x-a\right)^2}=-\frac{x}{\left(x-a\right)}+\int\frac{dx}{x-a}
=-\frac{x}{\left(x-a\right)}+ln\left(x-a\right)

but the right answer according to integrator (Mathematica, Maple) is:
\int\frac{xdx}{\left(x-a\right)^2}=-\frac{a}{\left(x-a\right)}+ln\left(x-a\right)

I'm missing some very small detail here...
 
Physics news on Phys.org
squarks said:
Hi. I'm trying to do a simple integration, but I cannot seem to get it. Please help!

Homework Statement


\int\frac{xdx}{\left(x-a\right)^2}

Homework Equations


I'm simply using integration by part using:
\int udv = uv - \int vdu
with:
u=x \rightarrow du=dx
dv=\frac{dx}{\left(x-a\right)^2} \rightarrow v=-\frac{1}{\left(x-a\right)}

The Attempt at a Solution


Just working it out:
\int\frac{xdx}{\left(x-a\right)^2}=-\frac{x}{\left(x-a\right)}+\int\frac{dx}{x-a}
=-\frac{x}{\left(x-a\right)}+ln\left(x-a\right)
Your answer works for me, but you need the constant of integration and the log expression should be an absolute value. IOW, like this:
-\frac{x}{(x-a)}+ln|x-a| + C

If you take the derivative of the above, you get the original integrand.

squarks said:
but the right answer according to integrator (Mathematica, Maple) is:
\int\frac{xdx}{\left(x-a\right)^2}=-\frac{a}{\left(x-a\right)}+ln\left(x-a\right)

I'm missing some very small detail here...
 
Last edited:
Hmm... Ok... I'm actually evaluating this within limits (from 0 to a constant b), but I was worried about the difference in the first term in the final result ("x" in my results and "a" in Mathematica/Maple).

I know not to trust Mathematica/Maple but it's rare that they both give me same erroneous outputs. Could someone else confirm that I did this right? Thanks!
 
Instead of using integration by parts, let u= x- a. Then x= u+ a so
\int \frac{x}{(x- a)^2} dx= \int\frac{u+ a}{u^2}du= \int \frac{1}{u}du+ \int au^{-1}du
= ln|u|- au^{-1}+ C= ln|x- a|- \frac{a}{x- a}+ C
 
Hmmmm

\int \frac{x}{(x-a)^2} \, dx = \int \frac{x-a+a}{(x-a)^2} \, dx = \int \frac{dx}{x-a} + a\int \frac{d(x-a)}{(x-a)^2} = \ln|x-a| - \frac{a}{x-a} + C
 
Well, the mystery is solved, because

-\frac{x}{x-a} = - \frac{x-a}{x-a} - \frac{a}{x-a}

-\frac{x}{x-a} = -1 -\frac{a}{x-a}

so that both the LHS and the RHS have the same derivative.
 
Well thanks HallsofIvy and dextercioby. So afterall Maple and Mathematica are right.

So what did I do wrong exactly in my steps using integration by parts? It should still give the same answer regardless of how it got there...
 
squarks said:
Well thanks HallsofIvy and dextercioby. So afterall Maple and Mathematica are right.

So what did I do wrong exactly in my steps using integration by parts? It should still give the same answer regardless of how it got there...

You didn't do anything wrong. Like dextercioby pointed out, the -x/(x-a) in your answer is the same as -1-a/(x-a). That differs from your answer by a constant. Add the "+C" and absorb the -1 into that.
 
Back
Top