# How to integrate expression with absolute value in it?

$f(x)={{\left| 1-x \right|}^{-0.5}}\exp (-{{\left| 1-x \right|}^{0.5}})$ for $x>0$

I was thinking to do a u-sub, $u={{\left| 1-x \right|}^{0.5}}$

but what would your $du$ be?

-
One definition of the absolute value is that abs($x$) $=x,$ if $x>0$ or $-x$ if $x<0.$ Try to determine where the terms inside the absolute value change sign. Once you've done this, you can break up the integral at those places and remove the absolute values. – Mike B Feb 12 '12 at 22:23
Already did, final answer below, is that correct? if so, why doesn't it sum to 1? I know it is suppose to. – user1061210 Feb 13 '12 at 0:44

If $u=\sqrt{|1-x|}$, then in fact $$u=\begin{cases} \sqrt{1-x},&\text{if }x\le 1\\\\ \sqrt{x-1},&\text{if }x>1\;, \end{cases}\tag{1}$$

since by definition $$|1-x|=\begin{cases} 1-x,&\text{if }1-x\ge 0\\\\ -(1-x)=x-1,&\text{if }1-x<0\;. \end{cases}$$

Thus, $$du=\begin{cases} -\frac12(1-x)^{-1/2}dx,&\text{if }x<1\\\\ \frac12(x-1)^{-1/2}dx,&\text{if }x>1\;. \end{cases}\tag{2}$$

Thus, you’ll need to split the integral in two, one for $x<1$ and one for $x>1$. (Why did I change $x\le 1$ in $(1)$ to $x<1$ in $(2)$?)

-
Hey, Brian. Thanks, it's pretty clear. I got a question on the $du$ part, where I got without the negative sign $$$\frac{1}{2}{{(1-x)}^{\frac{1}{2}}}dx$$$, did you let your u be the absolute value without negative signs? – user1061210 Feb 12 '12 at 23:15
@user1061210: I used $u$ as in $(1)$, so that there’s a factor of $-1$ from $(1-x)'$ in the derivative of the $x<1$ part. – Brian M. Scott Feb 12 '12 at 23:27
$$F(a)=\int{f(x)dx }=\left\{ \begin{array}{*{35}{l}} \frac{1}{2}{{e}^{-{{\left( 1-a \right)}^{0.5}}}}-\frac{1}{2}{{e}^{-1}} & 0<a\le 1 \\ 1-\frac{1}{2}{{e}^{-{{(a-1)}^{0.5}}}}-\frac{1}{2}{{e}^{-1}} & 1<a \\ \end{array} \right.\$$ I got the above answer after integration, it's a cumulative function, which should sum to 1, but it doesn't, do you know what's wrong with it? – user1061210 Feb 13 '12 at 0:38
Working rather hastily, I get $4-\frac2{e}$. Don’t forget that $dx=2u du$, so that you’re integrating $2e^{-u}du$. – Brian M. Scott Feb 13 '12 at 3:14
I figured it out, thanks everyone for trying to help. – user1061210 Feb 13 '12 at 4:05