1/x and ln|x|
The power rule for integrals stops at 1 over x, as Integrating powers shows. A logarithm fills the gap: the derivative of ln of x is 1 over x, as in The derivatives to know by heart. So ln of x is an antiderivative of 1 over x. But only for positive x.
Why the bars
1 over x exists on both sides of 0, but ln of x only for positive x, as in What a logarithm is. For negative x we need another antiderivative, and ln of the quantity minus x is one: minus x is positive there, and by The chain rule its derivative is 1 over the quantity minus x times minus 1, which is 1 over x again.
The absolute value the absolute value of x does both at once: it is x when x is positive and minus x when it is negative. So
The two branches of ln of the absolute value of x are mirror images. Where 1 over x is negative, on the left, ln of the absolute value of x falls; where it is positive, ln of the absolute value of x rises.
A number in front, and other terms
A number in front stays: 3 over x is 3 times 1 over x, so it becomes 3 ln of the absolute value of x. Next to powers, each term goes its own way:
Divide first
A fraction with a sum on top and x below is split up first, by dividing each term on top by x:
Now each term can be integrated:
With e as a bound
With bounds, as in Definite integrals, the logarithm often meets e, since ln of e is 1 and ln of 1 is 0:
which is twice 1 minus twice 0, so 2.
1/x integrates to ln|x|, not by the power rule. The bars make it work for negative x too. Divide a fraction by x first, term by term.