2

I try to calculate the following integral but am a bit confused with the |x|

$$\int_{-1}^1 (2-\left |x \right |)dx$$

The antiderivative should be:

$\begin{cases} 2x-\frac{x^2}{2} & x \geq 0 \\ 2x + \frac{x^2}{2} & x \lt 0 \end{cases}$

Is that correct? So it would mean:

$\left ( 2-\frac{1}{2}\right ) - \left ( 2+\frac{1}{2}\right ) = 1.5 - 2.5 = -1$

But that is not correct. It is supposed to be 3. Where did I do the mistake?

Chris
  • 521

5 Answers5

4

You've evaluated at the bounds incorrectly: Since you have $2x + x^2/2$, the second term should be $(-2 + \frac 1 2)$, which gives the correct answer.

3

Since $2-|x|$ is even function, we can obtain: $$\int_{-1}^1 (2-\left |x \right |)dx=2\int_0^1(2-|x|)dx=2\int_0^1(2-x)dx$$

LeeNeverGup
  • 2,671
1

$$\int_{-1}^1 (2-\left |x \right |)dx = \int_{-1}^0 (2-|x| )dx+ \int_{0}^1 (2-\left |x \right |)dx =\int_{-1}^0 (2+x )dx +\int_{0}^1 (2-x )dx$$

Hope this helps

JMCF125
  • 2,738
  • 1
  • 20
  • 34
voldemort
  • 13,182
0

It will be $$(2x+(1/2)x^2)\bigg|_{-1}^{0}+(2x-(1/2)x^2)\bigg|_{0}^{1}=0-(-2+(1/2))+(2-(1/2))=4-1=3.$$

mathlove
  • 139,939
0

You missed out a minus sign for the second $2$ in your equation. :)

An alternative is to split the integrals so that you can see from an easier light.

$$\int_{-1}^{1}(2-|x|)\ dx=\int_{-1}^{1}2\ dx-\int_{-1}^{1}|x|\ dx=2*(1+(-1))-\int_{-1}^{1}|x|\ dx$$

It all boils down to evaluating $$\int_{-1}^{1}|x|\ dx$$

Notice from the graph of $y=|x|$ that the area under the curve from $-1$ to $1$ is just simply the sum of two triangles with base and height $1$, which gives us a total area of $1$.

So $$\int_{-1}^{1}(2-|x|)\ dx=4-1=3$$

ireallydonknow
  • 1,415
  • 2
  • 14
  • 33