# Integration of $|f(x)|$

I would like to learn how to use the sign function $\operatorname{sgn}(x)$ to integrate the absolute value of an arbitrary function. I know that integrating piecewise should give me the same result, but sometimes trigonometric functions can become cumbersome. I have tried searching on the internet, but I can't seem to find anything. Perhaps the theory isn't complete, and the methods for integration aren't known for the absolute value of all functions, but I would appreciate if someone could give me one or two places where I can learn a general approach. What I would like to learn is integration for the absolute value of at least a second degree function, and the "basic" trigonometric functions (sin, cos, tan, csc, sec, cot). Links or references to information on the internet will be a lot more helpful to me than references to books. Thank you.

-
The most general advice for integrating $\int|f(x)|\mathrm dx$ is to find where $f(x)$ crosses the horizontal axis, and split your integral accordingly... at least, I know that computing environments with the ability to do this also use this approach. –  Ｊ. Ｍ. Aug 25 '11 at 3:19
The sign function approach not only gives the same result as integrating piecewise, there's also no deep difference between the two approaches, since the sign function, like the absolute value, is defined piecewise using a case distinction; it's basically just $\text{sgn}(x)=|x|/x$ (glossing over the details at $0$). You can express it algebraically e. g. as $\text{sgn}(x)=\sqrt{x^2}/x$ , but you can do the same thing with $|x|=\sqrt{x^2}$ directly. –  joriki Aug 25 '11 at 4:48
@ J.M., joriki: I understand what you mean, but it's just that integration of certain trigonometric functions can become very, very cumbersome. See, if the integral of a trig function has multiple roots, it can be easy to integrate by finding the area under of it it's "humps" and then multiplying that by the number of "humps". However, some trig functions have the property that their "humps" aren't uniform. Then it becomes very time consuming (unless there's an integration method I'm missing). What I mean by "hump" is the area under the curve of a sine function from two successive roots. –  Hautdesert Aug 27 '11 at 3:11
Sure. Sometimes you just have to bite the bullet and do the tear-inducing algebra... –  Ｊ. Ｍ. Aug 28 '11 at 17:52

I looked through some of my stuff last night and found the following references. However, all except one are not "links or references to information on the internet" (unless you have access to a university library), but perhaps by googling some of the titles and names you can come up with some useful items on the internet. I've listed them in the order (highest to lowest) that I'd guess as to how useful they'd be to you (with the exception of the last one, for which I've only seen the Nature summary).

Kenneth O. May, "The calculus of absolute values", American Mathematical Monthly 62 #9 (November 1955), 651-653. (here)

Margaret R. Wiscamb, "A formula for the derivative of the absolute value of a polynomial", Pi Mu Epsilon Journal 4 #9 (Fall 1968), 367-369.

C. Walmsley, "On the area of a square", Mathematical Gazette 38 #325 (September 1954), 210-211. (here)

John L. Spence, "Step function notation", School Science and Mathematics 60 #3 (March 1960), 179-180. (here)

Daryl E. Doan and Joshua Grusd, "Derivative and indefinite integral", Reader Reflections column, Mathematics Teacher 98 #5 (Dec./Jan. 2004/2005), 292.

"prove d|x|/dx = x/|x| without piecewise", MathKB discussion groups, Mathematics - General Topics, 27 January 2006. (here)

Nature (journal) 93 #2315 (12 March 1914), p. 39: Midway down the left column is a brief description of a Russian paper by I. N. Kouchnereff and D. Riabouchinsky that: "...treats this quantity [absolute value operation] as a function of the variable $x$, and shows how this method leads to interesting formulae involving the solution of equations, differentiation, and integration. A number of elegant geometrical applications are also given, such as equations of broken lines [polygonal curves?], and equations of limited portions [bounded?] of planes, such as a square area."

-
These references were helpful. Thank you. –  Hautdesert Aug 27 '11 at 3:13