Absolute value in definite integral. My answer differs from wolfram alphas. Why?

154 Views Asked by At

I'm in highschool and just started integration. I found the following problem in an old question paper and I find it very challenging.

$$\int_0^1\sqrt{x^2-2x+1} dx$$ so I simplified it algebraically to

$$\int_0^1\sqrt{(x-1)^2} dx$$ which of course is $$\int_0^1|x-1| dx$$ as the absolute value is a linear function over $x \in [0,\infty)$ so I proceed to evaluate it as $x^2/2-x$ for upper limit $1$ and lower limit $0$ which is $((1)^2/2 -1)-(0-0)$ and equals $-\frac12$, but according to wolfram alpha it is $\frac12$. link to wolframalpha's computation

Please explain at beginner level.

2

There are 2 best solutions below

0
On BEST ANSWER

for $x \in (0, 1), |x-1|=1-x$.

Hence we get $\frac12$.

Note that integrating a nonnegative function gives you nonnegative solution.

0
On

Note that when $x\le 1$ and $x\ge0$ $|x-1|=1-x$ from here you can get your answer of $1/2$
Your mistake is that you say $|x-1|$ is equal to $x-1$ in $[0,\infty)$ this is wrong it is only true for $x\ge 1$ but this does not help you .