Why does integration by parts give the wrong answer to $\int xy dx$?

182 Views Asked by At

Integrating directly: $$\int xydx = y \int x dx = y\left(\frac{x^2}{2}\right) = \frac{1}{2}x^2 y$$

Now let's instead integrate using the integration by parts formula: $$\int u dv = uv - \int v du$$

We have: $$\int xydx = x^2y-\int x d(xy) = x^2y- \int x(xdy+ydx) = x^2 y-\int x^2 dy-\int xy dx = x^2y-x^2y-\frac{1}{2}x^2y = -\frac{1}{2}x^2 y$$

Which is almost the right answer, except that the sign is wrong.

Question. What's going on here?

3

There are 3 best solutions below

0
On BEST ANSWER

$y$ is constant here. So $dy=0$. At least that is the way you treat it in the first integration.

0
On

If $$\int xy~\mathrm{d}x \equiv \int u~\mathrm{d}v$$ Then $$\begin{align*}u = x &\implies \mathrm{d}u = \mathrm{d}x\\ \mathrm{d}v = y~\mathrm{d}x &\implies v = xy\end{align*}$$ Now $$\int u~\mathrm{d}v = uv - \int v~\mathrm{d}u$$ Plug in the values from above $$\int u~\mathrm{d}v = x \cdot xy - \int xy\cdot\mathrm{d}x = x^2y - \frac{1}{2}x^2y = \frac{1}{2}x^2y$$ Alternatively, $$\begin{align*}u = xy &\implies \mathrm{d}u = y~\mathrm{d}x\\ \mathrm{d}v = \mathrm{d}x &\implies v = x\end{align*}$$ $$\int u~\mathrm{d}v = xy \cdot x - \int x\cdot y~\mathrm{d}x = x^2y - \frac{1}{2}x^2y = \frac{1}{2}x^2y$$

0
On

For $$\int xydx = y \int x dx = y\left(\frac{x^2}{2}\right) = \frac{1}{2}x^2 y$$

You are assuming $y$ is a constant while for

$$\int xydx = x^2y-\int x d(xy) = x^2y- \int x(xdy+ydx) = x^2 y-\int x^2 dy-\int xy dx = x^2y-x^2y-\frac{1}{2}x^2y = -\frac{1}{2}x^2 y$$

You are assuming that $y$ depends on $x$

That is why you are getting differenet results.