AP Calculus AB and BC

Integral of 1/(2x): Answer, Proof, and Steps

The integral of 1/(2x) is (1/2)ln|x| + C. The constant 1/2 pulls out of the integral, leaving the integral of 1/x, which is ln|x|. The absolute value is required because 1/(2x) is defined for every x except 0.

12xdx=12lnx+C\int \frac{1}{2x}\,dx = \frac{1}{2}\ln|x| + C

Factor out the constant

The 12\frac{1}{2} is a constant multiplier, and constants slide outside an integral untouched. What remains is the standard integral of 1x\frac{1}{x}.

12xdx=121xdx\int \frac{1}{2x}\,dx = \frac{1}{2}\int \frac{1}{x}\,dx

Since ddxlnx=1x\frac{d}{dx}\ln|x| = \frac{1}{x}, the inside integral is lnx\ln|x|.

12xdx=12lnx+C\int \frac{1}{2x}\,dx = \frac{1}{2}\ln|x| + C

Why the bars are not optional

The function 12x\frac{1}{2x} is defined for every x0x \neq 0, including negatives, but lnx\ln x exists only for x>0x > 0. The absolute value extends the antiderivative to the negative side, where the chain rule on ln(x)\ln(-x) produces the same 1x\frac{1}{x}.

x<0:ddxln(x)=1x(1)=1xx < 0:\quad \frac{d}{dx}\ln(-x) = \frac{1}{-x}\cdot(-1) = \frac{1}{x}

Multiplying back by 12\frac{1}{2} recovers 12x\frac{1}{2x} on both branches.

The mistake students make

The genuine error is dropping the absolute value and writing 12lnx\frac{1}{2}\ln x, which throws away every negative xx. A separate slip is folding the 2 into the log as 12ln2x\frac{1}{2}\ln|2x|; since ln2x=ln2+lnx\ln|2x| = \ln 2 + \ln|x|, that form only adds the constant 12ln2\frac{1}{2}\ln 2, so it is unsimplified rather than wrong.

Constant out front, bars on the log

Pull the 12\frac{1}{2} outside, integrate 1x\frac{1}{x} to lnx\ln|x|, and keep the bars. Only skip the absolute value when the domain is known to stay positive.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

Is (1/2)ln|x| the same as ln|x|/2?

Yes, they are identical. 12lnx\frac{1}{2}\ln|x| and lnx2\frac{\ln|x|}{2} are two ways of writing the same expression.

Can I write the answer as (1/2)ln|2x|?

You can, but it only adds the constant 12ln2\frac{1}{2}\ln 2, which the +C+C already covers. The cleaner form is 12lnx+C\frac{1}{2}\ln|x| + C.

Why not use a u = 2x substitution?

You can. With u=2xu = 2x, du=2dxdu = 2\,dx, the integral becomes 121udu=12lnu=12ln2x\frac{1}{2}\int\frac{1}{u}\,du = \frac{1}{2}\ln|u| = \frac{1}{2}\ln|2x|, which simplifies to 12lnx\frac{1}{2}\ln|x| up to a constant. Factoring the constant out first is quicker.