# How to integrate $\sqrt{x^2}$ using standard integration techniques?

How to find the indefinite integral of $\sqrt{x^2}$ with respect to $x$ without simplifying it to $|x|$ (which would be wrong in a complex setting)?

What I wanted to know generally how to integrate symbolically a power of a power without simplifying it with the power-rule. Mathematica is giving:

$\int{(x^n)^a}{dx} = \frac{x(x^n)^a}{1+an}$

How does Mathematica find this formula? With substitution, table lookup or another technique?

• Can you please give more information. Do you want a definite or indefinite integral? – Fly by Night Apr 1 '14 at 20:14
• indefinite integral – Andrei Kh Apr 1 '14 at 20:16
• You might like to add that to your question... – Fly by Night Apr 1 '14 at 20:17
• In a complex setting $\sqrt{x^2}$ is either $x$ or $-x$, depending on which branch of the square root you choose. Each of these is simple to integrate. If you have a domain where both branches are used at different points, there will not be any antiderivative to find! – Henning Makholm Apr 1 '14 at 21:47

Some ideas:

Method 1: Define $$g(x) = \frac{1}{2}x\sqrt{x^2}$$ and show that $$\lim_{h\rightarrow 0}\frac{g(a+h)-g(h)}{h}=\sqrt{a^2}$$ for every $a$. That is, $g^\prime(x) = \sqrt{x^2}$. Then invoke the Fundamental Theorem of Calculus.

Method 2 (physics): Integrate $$\int{\sqrt{x^2+c^2}} = \frac{1}{2}x\sqrt{x^2+c^2}+\frac{1}{2}c^2\log(x+\sqrt{x^2+c^2})$$ and put $c=0$.

$$\sqrt{x^2}=x^\frac{2}{2}$$

$$\int \left(x^\frac{2}{2}\right) dx=\frac{2x^\frac{4}{2}}{4}=\frac{x^\frac{4}{2}}{2}$$

$$\therefore \frac{x^\frac{4}{2}}{2}=\frac{\sqrt{x^4}}{2}=\frac{x\sqrt{x^2}}{2}$$

(You don't take out the $x^2$, that's the only difference)

Here's a visual:

The curved one is the derivative. The slope is negative when $x$ is negative, and positive when $x$ is positive. If you just had $\frac{x^2}{2}$, it would be wrong because it would show that the slope is only positive.

• Not sure whether you can do $\sqrt{x^2}=x^\frac{2}{2}$... Most people would say $x^\frac{2}{2}=x$, even if told $\exists x\neq\sqrt{x^2}$. – JMCF125 Apr 1 '14 at 20:26
• @JMCF125 It's very unconventional but I don't think it's mathematically wrong. Plus, helps visualize the process of taking the integral. – Shahar Apr 1 '14 at 20:32
• I guess you're right. +1 then. – JMCF125 Apr 1 '14 at 20:37
• I think this is more sleight-of-hand than an actual derivation. Never mind the $\frac22$ -- how do you argue in a principled way that you can do $\sqrt{x^4}=x\sqrt{x^2}$ in the last step without also allowing $\sqrt{x^2}=x\sqrt{1}$? – Henning Makholm Apr 1 '14 at 21:55
• @HenningMakholm You need it to be negative when $x$ is negative. I showed a picture, check it. – Shahar Apr 1 '14 at 21:57