Re: How to Integrate[Abs[x]]?

*To*: mathgroup at smc.vnet.net*Subject*: [mg91644] Re: [mg91624] How to Integrate[Abs[x]]?*From*: Murray Eisenberg <murray at math.umass.edu>*Date*: Sat, 30 Aug 2008 01:53:11 -0400 (EDT)*Organization*: Mathematics & Statistics, Univ. of Mass./Amherst*References*: <200808290825.EAA24127@smc.vnet.net>*Reply-to*: murray at math.umass.edu

You could use either of the following: Integrate[Abs[x], x, Assumptions -> x \[Element] Reals] // InputForm Piecewise[{{-x^2/2, x <= 0}}, x^2/2] g[x_]=Piecewise[{{x,x>=0},{-x,x<0}}] Integrate[g[x],x] // InputForm Piecewise[{{-x^2/2, x <= 0}}, x^2/2] (In both cases I used InputForm for the answer since it's awkward to reproduce the 2D Piecewise output in linear e-mail text.) Of course if you have a definite integral, there's no difficulty using Abs[x] directly, e.g.: Integrate[Abs[x],{x,-2,1}] 5/2 Thomas Dybdahl Ahle wrote: > On my Ti calculater |x| is easily integrated to |x|*x/2, but when I type Integrate[Abs[x],x] in mathematica, it seams like it can't find the solution. > Is there anything I'll have to do, to make mathematica find the solution? > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305

**References**:**How to Integrate[Abs[x]]?***From:*Thomas Dybdahl Ahle <lobais@gmail.com>