Integral of 2+1x-2 + \frac{1}{x}

The calculator will find the integral/antiderivative of 2+1x-2 + \frac{1}{x}, with steps shown.

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as dxdx, dydy etc.
Leave empty for autodetection.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please contact us.

Your Input

Find (2+1x)dx\int \left(-2 + \frac{1}{x}\right)\, dx.

Solution

Integrate term by term:

(2+1x)dx=(2dx+1xdx){\color{red}{\int{\left(-2 + \frac{1}{x}\right)d x}}} = {\color{red}{\left(- \int{2 d x} + \int{\frac{1}{x} d x}\right)}}

Apply the constant rule cdx=cx\int c\, dx = c x with c=2c=2:

1xdx2dx=1xdx(2x)\int{\frac{1}{x} d x} - {\color{red}{\int{2 d x}}} = \int{\frac{1}{x} d x} - {\color{red}{\left(2 x\right)}}

The integral of 1x\frac{1}{x} is 1xdx=ln(x)\int{\frac{1}{x} d x} = \ln{\left(\left|{x}\right| \right)}:

2x+1xdx=2x+ln(x)- 2 x + {\color{red}{\int{\frac{1}{x} d x}}} = - 2 x + {\color{red}{\ln{\left(\left|{x}\right| \right)}}}

Therefore,

(2+1x)dx=2x+ln(x)\int{\left(-2 + \frac{1}{x}\right)d x} = - 2 x + \ln{\left(\left|{x}\right| \right)}

Add the constant of integration:

(2+1x)dx=2x+ln(x)+C\int{\left(-2 + \frac{1}{x}\right)d x} = - 2 x + \ln{\left(\left|{x}\right| \right)}+C

Answer

(2+1x)dx=(2x+ln(x))+C\int \left(-2 + \frac{1}{x}\right)\, dx = \left(- 2 x + \ln\left(\left|{x}\right|\right)\right) + CA