Content translated by ChatGPT.

Before We Begin

Suppose you plant an electromagnetic bomb inside a power station in Night City, attempting to use the shockwave produced by destroying the station to bring down the AV carrying the ripperdoc. The problem is that the shockwave has an enormous blast radius, so you must escape to a safe distance to avoid getting caught in it. Unfortunately, because of interference drones and the invisible hand of the NCPD, you cannot use satellite maps to check your location. What should you do?

The good news is that you can record the velocity curve displayed on your car’s dashboard and ask the ever-annoying Johnny to calculate a function describing your speed. “This is easy, V,” Johnny says. “We can use indefinite integrals to effortlessly find the functional relationship between time and distance travelled.”

pasted-image-1780316213606.webp

What Is an Integral?

First of all, we know that differentiation breaks a function down into infinitesimal changes in order to calculate how the function changes locally. Integration, on the other hand, is the opposite of differentiation: it accumulates the infinitesimal changes of a function one by one to obtain the whole.

From the abstract perspective of functions, when we differentiate the function y=f(x)y=f(x) and divide the two infinitesimal changes dydy and dxdx, we obtain the instantaneous rate of change of the function at that point, which is the derivative:

f(x)=dydxf'(x)=\frac{\mathrm{d}y}{\mathrm{d}x}

What integration does is accumulate the tiny changes produced within each small segment, thereby obtaining the overall change:

f(x1)f(x0)=Δyf(x_1)-f(x_0)=\sum \Delta y

As the interval is divided into increasingly finer segments, the actual change ΔyΔy within each segment can be represented by the differential dydy. By adding up all the infinitesimal changes dydy from x0x_0 to x1x_1, we can obtain the change in the function from x0x_0 to x1x_1. In other words, this is the definite integral of the derivative function over that interval:

f(x1)f(x0)=x0x1,dy=x0x1f(x),dxf(x_1) - f(x_0)= \int_{x_0}^{x_1} , dy = \int_{x_0}^{x_1} f'(x) , \mathrm{d}x

We will discuss the details and geometric interpretation of definite integrals more carefully in the next section. For now, let us rearrange the formula:

f(x1)=f(x0)+x0x1f(x),dxf(x_1) = f(x_0) + \int_{x_0}^{x_1} f'(x) , \mathrm{d}x

Here, the function value at the starting point, f(x0)f(x_0), is a constant. If no initial value is specified, we can write it as an arbitrary constant CC:

f(x1)=C+x0x1f(x),dxf(x_1) = C + \int_{x_0}^{x_1} f'(x) , \mathrm{d}x

When we stop using a fixed, known x1x_1 as the upper limit of the definite integral and replace it with a variable xx, we obtain the formula for indefinite integrals:

f(x),dx=f(x)+C\int f'(x) , \mathrm{d}x = f(x) + C

A definite integral with a variable upper limit gives us one specific antiderivative. An indefinite integral adds an arbitrary constant CC to that antiderivative, representing all possible antiderivatives.

Basic Concepts of Indefinite Integrals

Definition

Although we derived the formula for indefinite integrals in the introduction through a whole bunch of flashy steps that nobody can understand anyway, an introduction is still just an introduction. It is not a big deal if you skip the entire thing.

So, what are indefinite integrals useful for?

Definition: The collection of all antiderivatives of f(x)f(x) is called the indefinite integral of f(x)f(x).

That is right. An indefinite integral is essentially this: given the derivative of a function, work backwards to find the original function.

Compared with differentiation, differentiation breaks a function down into its local pattern of change. An indefinite integral restores the original function from that local pattern of change.

Theorem

“Very good, V.” Johnny tilts up his sunglasses, which he thinks make him look cool. “Then do you know why a function f(x)f(x) that is continuous on an interval II must have an antiderivative on that interval?”

Theorem: If f(x)f(x) is continuous on an interval II, then f(x)f(x) must have an antiderivative on the interval II.

Let us take an example, Johnny says, turning his gaze back to the car’s dashboard.

Suppose we define a function relating velocity to time:

v(t)v(t)

Then we can easily define:

s(t)=t0tv(u),dus(t)=\int_{t_0}^{t}v(u) , \mathrm{d}u

It represents the displacement from t0t_0 to tt.

Suppose we drive for a very short amount of time Δt\Delta t. The additional distance travelled can be approximated by:

Δsv(t)Δt\Delta s \approx v(t) \Delta t

That is:

ΔsΔtv(t)\frac{\Delta s}{\Delta t} \approx v(t)

As Δt0\Delta t → 0, we can treat the expression above as:

dsdt=s(t)=v(t)\frac{\mathrm{d}s}{\mathrm{d}t} = s'(t) = v(t)

This is the differentiation formula for an integral with a variable upper limit:

(t0tv(u),du)=v(t)(\int_{t_0}^{t}v(u) , \mathrm{d}u)'=v(t)

This shows that for any continuous velocity function v(t)v(t), there exists at least one position function s(t)s(t) whose derivative is exactly v(t)v(t).

Intuitively, when we drive, a continuously changing velocity gives us a known increment in distance during every tiny interval of time, which ensures that our distance function exists.

Then what happens when f(x)f(x) is not continuous?

Theorem: If f(x)f(x) has a discontinuity of the first kind on an interval II, then f(x)f(x) has no antiderivative on the interval II.

In fact, from what we learned in high school, we already know that for:

f(x)=xf(x) = |x|

f(x)f(x) is not differentiable at x=0x=0.

Intuitively, the derivative is the slope of the tangent line of a function. At a sharp corner like this, there is no tangent line, so naturally the derivative does not exist.

Now let us think in reverse. For:

f(x)={1,x0, 1,x<0.f(x)= \begin{cases} 1, & x \geq 0, \ -1, & x < 0. \end{cases}

there is no antiderivative either.

If we forcibly assume that it has an antiderivative F(x)F(x), then:

limx0+F(x)=1 limx0F(x)=1\lim_{x \to 0^+} F'(x) = 1 \ \lim_{x \to 0^-} F'(x) = -1

Therefore, F(x)F'(x) jumps from 1-1 to 11 at x=0x=0. However, according to Darboux’s theorem, derivatives have the intermediate value property. In other words, there must be some point between 1-1 and 11 where the derivative takes the value 00, as well as points where it takes the other values between 1-1 and 11.

However, this F(x)F'(x) can only take the values 11 and 1-1. This produces a contradiction, so f(x)f(x) has no antiderivative.

How to Calculate Indefinite Integrals

“V, now that you know what an indefinite integral is, do you know how to find the antiderivative when someone hands you a formula?” Johnny shouts at you through a hail of bullets fired by the drones.

“Easy!” He pulls a scrap of paper out of nowhere. “The first thing you need to hammer into your head is…”

Basic Formulas for Indefinite Integrals

(Click to expand)
  1. 0,dx=C\displaystyle \int 0,\mathrm{d}x=C

  2. xα,dx=1α+1xα+1+C(α1)\displaystyle \int x^\alpha,\mathrm{d}x=\frac{1}{\alpha+1}x^{\alpha+1}+C \qquad (\alpha\neq -1)

  3. 1x,dx=lnx+C\displaystyle \int \frac{1}{x},\mathrm{d}x=\ln |x|+C

  4. ax,dx=axlna+C(a>0, a1)\displaystyle \int a^x,\mathrm{d}x=\frac{a^x}{\ln a}+C \qquad (a>0,\ a\neq 1)

  5. ex,dx=ex+C\displaystyle \int e^x,\mathrm{d}x=e^x+C

  6. sinx,dx=cosx+C\displaystyle \int \sin x,\mathrm{d}x=-\cos x+C

  7. cosx,dx=sinx+C\displaystyle \int \cos x,\mathrm{d}x=\sin x+C

  8. sec2x,dx=tanx+C\displaystyle \int \sec^2 x,\mathrm{d}x=\tan x+C

  9. csc2x,dx=cotx+C\displaystyle \int \csc^2 x,\mathrm{d}x=-\cot x+C

  10. secxtanx,dx=secx+C\displaystyle \int \sec x\tan x,\mathrm{d}x=\sec x+C

  11. cscxcotx,dx=cscx+C\displaystyle \int \csc x\cot x,\mathrm{d}x=-\csc x+C

  12. 11x2,dx=arcsinx+C\displaystyle \int \frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\arcsin x+C

  13. 11+x2,dx=arctanx+C\displaystyle \int \frac{1}{1+x^2},\mathrm{d}x=\arctan x+C

  14. dxa2x2=arcsinxa+C\displaystyle \int \frac{\mathrm{d}x}{\sqrt{a^2-x^2}}=\arcsin \frac{x}{a}+C

  15. dxa2+x2=1aarctanxa+C\displaystyle \int \frac{\mathrm{d}x}{a^2+x^2}=\frac{1}{a}\arctan \frac{x}{a}+C

  16. dxx2a2=12alnxax+a+C\displaystyle \int \frac{\mathrm{d}x}{x^2-a^2}=\frac{1}{2a}\ln \left|\frac{x-a}{x+a}\right|+C

  17. dxx2+a2=ln(x+x2+a2)+C\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2+a^2}}=\ln \left(x+\sqrt{x^2+a^2}\right)+C

  18. dxx2a2=lnx+x2a2+C\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2-a^2}}=\ln \left|x+\sqrt{x^2-a^2}\right|+C

  19. secx,dx=lnsecx+tanx+C\displaystyle \int \sec x,\mathrm{d}x=\ln |\sec x+\tan x|+C

  20. cscx,dx=lncscx+cotx+C\displaystyle \int \csc x,\mathrm{d}x=-\ln |\csc x+\cot x|+C

“Remember, no matter what kind of integral you encounter, your first priority is to manipulate the algebraic expression until it matches one of these basic integral formulas. Got it?” Johnny shoves the scrap of paper into your hands.

Integration by Substitution: The First Method

When studying differentiation, we clearly know that:

dydx=f(x)\frac{\mathrm{d}y}{\mathrm{d}x}=f'(x)

That is:

dy=df(x)=f(x)dx\mathrm{d}y = \mathrm{d}f(x) = f'(x)\mathrm{d}x

Then it is obvious that:

f[φ(x)]φ(x),dx=f[φ(x)],dφ(x)=F[φ(x)]+C\int f[\varphi(x)]\varphi'(x) , \mathrm{d}x = \int f[\varphi(x)] , \mathrm{d} \varphi(x) = F[\varphi(x)] + C

We can also understand this from the perspective of the chain rule.

If we differentiate the composite function F(φ(x))F(\varphi(x)), we easily obtain:

F[φ(x)]=F[φ(x)]φ(x)=f[φ(x)]φ(x)F[\varphi(x)]' = F'[\varphi(x)]\varphi'(x) = f[\varphi(x)]\varphi'(x)

Therefore, integrating it in reverse gives us the formula above.

Common Patterns for Completing the Differential (Click to expand)
  1. f(ax+b),dx=1af(ax+b),d(ax+b)\displaystyle \int f(ax+b),\mathrm{d}x=\frac{1}{a}\int f(ax+b),\mathrm{d}(ax+b)

  2. xmf!(axm+1+b),dx=1(m+1)af!(axm+1+b),d!(axm+1+b)(m1)\displaystyle \int x^m f!\left(ax^{m+1}+b\right),\mathrm{d}x=\frac{1}{(m+1)a}\int f!\left(ax^{m+1}+b\right),\mathrm{d}!\left(ax^{m+1}+b\right)\quad (m\neq -1)

  3. f(x)dxx=2f(x),d(x)\displaystyle \int f(\sqrt{x})\frac{\mathrm{d}x}{\sqrt{x}}=2\int f(\sqrt{x}),\mathrm{d}(\sqrt{x})

  4. f(ex)ex,dx=f(ex),d(ex)\displaystyle \int f(e^x)e^x,\mathrm{d}x=\int f(e^x),\mathrm{d}(e^x)

  5. f(lnx)1x,dx=f(lnx),d(lnx)\displaystyle \int f(\ln x)\frac{1}{x},\mathrm{d}x=\int f(\ln x),\mathrm{d}(\ln x)

  6. f(sinx)cosx,dx=f(sinx),d(sinx)\displaystyle \int f(\sin x)\cos x,\mathrm{d}x=\int f(\sin x),\mathrm{d}(\sin x)

  7. f(cosx)sinx,dx=f(cosx),d(cosx)\displaystyle \int f(\cos x)\sin x,\mathrm{d}x=-\int f(\cos x),\mathrm{d}(\cos x)

  8. f(tanx)1cos2x,dx=f(tanx),d(tanx)\displaystyle \int f(\tan x)\frac{1}{\cos^2 x},\mathrm{d}x=\int f(\tan x),\mathrm{d}(\tan x)

  9. f(arcsinx)11x2,dx=f(arcsinx),d(arcsinx)\displaystyle \int f(\arcsin x)\frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\int f(\arcsin x),\mathrm{d}(\arcsin x)

  10. f(arctanx)11+x2,dx=f(arctanx),d(arctanx)\displaystyle \int f(\arctan x)\frac{1}{1+x^2},\mathrm{d}x=\int f(\arctan x),\mathrm{d}(\arctan x)

Looks familiar? Integrals like these are happening all across the country, and you could be next ☝️

There is no need to memorize these formulas specifically. Just do more definite integral exercises and you will naturally get used to them. (runs away)

Method 2: Substitution (Second Type)

Sometimes the expression we have cannot be directly handled by the first substitution method. For example:

x2a2x2,dx\int \frac{x^2}{\sqrt{a^2-x^2}},\mathrm{d}x

At first glance, how do we solve this? Don’t panic — here we can pick a suitable substitution x=ϕ(t)x = \phi(t) to replace xx in the integral.

The three most commonly used substitutions are:

1. Trigonometric Substitution

  1. If the integrand has a2x2\sqrt{a^2-x^2}, set x=asintx = a \sin t or x=acostx = a \cos t.

  2. If the integrand has a2+x2\sqrt{a^2+x^2}, set x=atantx = a \tan t.

  3. If the integrand has x2a2\sqrt{x^2 - a^2}, set x=asectx = a \sec t.

Then for the integral above, we can immediately spot the solution. Substituting x=asintx = a \sin t gives:

Original Integral=a2sin2tacost,d(asint) =a2sin2tacostacost,dt =a2sin2t,dt\begin{aligned} \text{Original Integral} &= \int \frac{a^2\sin^2 t}{a\cos t},\mathrm{d}(a\sin t) \ &= \int \frac{a^2\sin^2 t}{a\cos t}\cdot a\cos t,\mathrm{d}t \ &= \int a^2\sin^2 t,\mathrm{d}t \end{aligned}

The next steps are straightforward.

“Trig functions are super important in integrals.” Johnny crosses his legs and pulls out a cigar. “V, you should pay extra attention to methods like this.”

What a show-off.

2. Radical Substitution

When the integrand contains ax+bn\sqrt[n]{ax + b}, we can set t=ax+bnt = \sqrt[n]{ax + b}, so that x=1a(tnb)x = \frac{1}{a}(t^n - b).

3. Reciprocal Substitution

When the degree of the polynomial in the denominator is higher than in the numerator, we can set x=1tx = \frac{1}{t}.

Integration by Parts

Somewhere in our memory, there’s a formula buried:

If u(x)u(x) and v(x)v(x) both have continuous derivatives, then

(uv)=uv+uv(uv)' = u'v + uv'

Now we can rearrange:

uv=(uv)uvuv' = (uv)' - u'v

Integrate both sides:

uv,dx=(uv)uv,dx\int uv',\mathrm{d}x = \int (uv)' - u'v , \mathrm{d}x

Rewriting gives:

u,dv=uvv,du\int u , \mathrm{d}v = uv - \int v , \mathrm{d}u

Yes! This is the famous integration by parts! Useful for products of two algebraic expressions.

“Hmph, that was so easy to derive.” Johnny flicks ash off his cigar disdainfully. “If I had been born back then, I would’ve discovered it for sure.”

The beauty of integration by parts is that it can transform a messy, chaotic expression into something much easier to integrate.

Remember this one?

11+x2,dx=arctanx+C\int \frac{1}{1+x^2} , \mathrm{d}x = \arctan x + C

Now, what about:

arctanx,dx=?\int \arctan x , \mathrm{d}x = ?

“You won’t crack this by brute force,” Johnny snorts.

Unless…

Exactly! Use integration by parts!

The integral becomes:

Original Integral=xarctanxx,d(arctanx) =xarctanxx11+x2,dx \begin{aligned} \text{Original Integral} &= x\cdot\arctan x - \int x , \mathrm{d}(\arctan x)\ &= x\cdot\arctan x - \int x \frac{1}{1+x^2} , \mathrm{d}x \ \end{aligned}

Ah, now it makes sense. Then we just use basic integral formulas:

Original Integral=xarctanx+1211+x2,d(x2) =xarctanx+12ln(1+x2)\begin{aligned} \text{Original Integral} &= x\cdot\arctan x + \frac{1}{2} \int \frac{1}{1+x^2} , \mathrm{d}(x^2) \ &= x\cdot\arctan x + \frac{1}{2} \ln(1+x^2) \end{aligned}

Magic, right?!

Integrals of Rational Trig Functions

“I told you…”

Ah… here he goes again…

“V, rational trig functions are super important in indefinite integrals.” Johnny points his cigar at you.

If we encounter integrals of the form R(sinx,cosx),dx\int R(\sin x, \cos x) , \mathrm{d}x (including sinnxcosmx\sin^n x \cdot \cos^m x), we can consider the following substitutions:

  • If sinx\sin x is raised to an odd power and cosx\cos x to an even power, try to extract d(cosx)\mathrm{d}(\cos x) or d(secx)\mathrm{d}(\sec x).

  • If sinx\sin x is even and cosx\cos x is odd, try to extract d(sinx)\mathrm{d}(\sin x) or d(cscx)\mathrm{d}(\csc x).

  • If both sinx\sin x and cosx\cos x are odd/even, try to extract d(tanx)\mathrm{d}(\tan x) or d(cotx)\mathrm{d}(\cot x).

Now consider:

13+sin2xdx=?\int \frac{1}{3+\sin^2x} \mathrm{d}x = ?

With sharp attention, we notice that sinx\sin x has power 2, and cosx\cos x has power 0. So both sinx\sin x and cosx\cos x are even powers. Then we try to form d(tanx)\mathrm{d}(\tan x) or d(cotx)\mathrm{d}(\cot x). How?

We notice the integrand contains sinx\sin x, so to extract the target expression…

Divide both numerator and denominator by cos2x\cos^2 x:

Original Integral=sec2x3sec2x+sin2xcos2x,dx =sec2x3sec2x+tan2x,dx\begin{aligned} \text{Original Integral} &= \int \frac{\sec^2 x}{3\sec^2x + \frac{\sin^2x}{\cos^2x}} ,\mathrm{d}x \ &= \int \frac{\sec^2 x}{3\sec^2x + \tan^2x} ,\mathrm{d}x \end{aligned}

Next step?

Check the basic integral formulas — notice sec2x\sec^2 x and tanx\tan x are suspiciously convenient.

Exactly. Then:

Original Integral=(tanx)3(tan2x+1)+tan2x,dx\begin{aligned} \text{Original Integral} &= \int \frac{(\tan x)'}{3(\tan^2 x + 1) + \tan^2x} , \mathrm{d}x \end{aligned}

Whoa, tricky!

Original Integral=14tan2x+3,d(tanx) =121(2tanx)2+(3)2,d(2tanx)\begin{aligned} \text{Original Integral} &= \int \frac{1}{4\tan^2 x + 3} , \mathrm{d}(\tan x) \ &= \frac{1}{2} \int \frac{1}{(2\tan x)^2 + (\sqrt{3})^2} , \mathrm{d}(2\tan x) \end{aligned}

For convenience, let 2tanx=u2\tan x = u, then:

Original Integral=121u2+(3)2,du\begin{aligned} \text{Original Integral} &= \frac{1}{2} \int \frac{1}{u^2 + (\sqrt{3})^2} , \mathrm{d}u \end{aligned}

Using the basic formula, the integral evaluates to:

Original Integral=123arctan(u3)+C =123arctan(2tanx3)+C\begin{aligned} \text{Original Integral} &= \frac{1}{2\sqrt3}\arctan\left(\frac{u}{\sqrt3}\right) + C \ &= \frac{1}{2\sqrt3}\arctan\left(\frac{2\tan x}{\sqrt3}\right) + C \end{aligned}

Integrals of Rational Functions

“Knowing trig functions alone isn’t enough, V. Too much trig will make your brain all pointy.”

“To become a true integral chad of Night City, you also need to know how to deal with integrals of rational functions.”

Theorem: A proper rational fraction of the form P(x)Q(x)=P(x)c0(xa)k(x2+px+q)l\frac{P(x)}{Q(x)} = \frac{P(x)}{c_0(x-a)^k(x^2+px+q)^l}, where kk and ll are positive integers and p24q<0p^2-4q < 0, can be uniquely decomposed into the sum of a finite number of partial fractions in their simplest forms.

That is, it can be decomposed as:

P(x)Q(x)=A1xa+A2(xa)2+...+Ak(xa)k+B1x+D1x2+px+q+B2x+D2(x2+px+q)2+...+Blx+Dl(x2+px+q)l\frac{P(x)}{Q(x)} = \frac{A_1}{x-a} + \frac{A_2}{(x-a)^2} + ... + \frac{A_k}{(x-a)^k}+\frac{B_1x+D_1}{x^2+px+q}+\frac{B_2x+D_2}{(x^2+px+q)^2}+...+\frac{B_lx+D_l}{(x^2+px+q)^l}

At this point, the expression contains nothing but the simplest algebraic terms. All we need to do is integrate them one by one… right?

“No, no, no. Solving for the undetermined coefficients above isn’t that easy,” Johnny explains with a sneer.

“Are you seriously planning to mash everything together and brute-force the polynomial coefficients? Don’t be stupid. In a situation like ours, every second counts. We don’t have time for that.”

“So allow the legendary Johnny Silverhand himself to tell you how to handle cases like this 😎☝️”

Special Method 1: Substitute Special Values for x

Try to choose each substituted value so that only one coefficient remains.

Here’s a chestnut 🌰:

Find x3(x1)(x21),dx\text{Find }\int \frac{x-3}{(x-1)(x^2 - 1)} , \mathrm{d}x

It is not difficult to obtain:

Original Expression=Ax+B(x1)2+Dx+1 =(Ax+B)(x+1)+D(x1)2(x1)2(x+1)\begin{aligned} \text{Original Expression} &= \frac{Ax+B}{(x-1)^2} + \frac{D}{x+1} \ &= \frac{(Ax+B)(x+1) + D(x-1)^2}{(x-1)^2(x+1)} \end{aligned}

That is, we need to calculate:

x3=(Ax+B)(x+1)+D(x1)2x - 3 = (Ax+B)(x+1) + D(x-1)^2

Using our astonishing powers of observation, we can first set x=1x = -1. Then:

13=D(11)2 D=1-1-3=D(-1-1)^2 \ D=-1

Next, set x=0x=0 and substitute D=1D = -1:

3=B1 B=2-3 = B - 1\ B=-2

Finally, just substitute x=1x = 1, and we obtain A=1A = 1.

Special Method 2: The Residue Method + Taking the Limit as x -> ∞

Consider this problem:

Find x3(x1)(x21),dx\text{Find } \int \frac{x-3}{(x-1)(x^2-1)} , \mathrm{d}x

It is easy to see that:

x3(x1)(x21)=Ax1+B(x1)2+Dx+1\frac{x-3}{(x-1)(x^2-1)} = \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{D}{x+1}

First, multiply both sides by x+1x+1. This gives:

x3(x1)2=[Ax1+B(x1)2](x+1)+D\frac{x-3}{(x-1)^2} = [\frac{A}{x-1} + \frac{B}{(x-1)^2}](x+1) + D

At this point, sharp-eyed readers will notice that we only need to set x=1x=-1 to delete both of those chunks on the right-hand side! Thus:

13(11)2=0+D D=2\frac{-1-3}{(-1-1)^2} = 0 + D \ D = -2

Then what about the remaining AA and BB?

We can deal with BB in the same way: multiply both sides by (x1)2(x-1)^2, and we obtain B=1B = -1.

Then how do we calculate AA?

It is time for the limit method to enter the stage.

Multiply both sides by xx and let xx \to ∞:

limx(x3)x(x1)(x21)=limxAxx1+limxBx(x1)2+limxDxx+1\lim_{x \to \infty} \frac{(x-3)x}{(x-1)(x^2-1)} = \lim_{x \to \infty} \frac{Ax}{x-1} + \lim_{x \to \infty} \frac{Bx}{(x-1)^2} + \lim_{x \to \infty} \frac{Dx}{x+1}

Based on the resulting limits, it is not difficult to obtain:

0=A+0+D0=A+0+D

Substituting D=1D = -1 gives A=1A=1.

After That

“All right, that should do it.” Johnny shouts at you. Your car has stopped on a hilltop overlooking the entire power station, where towering spires rise into the clouds in orderly rows. As dusk deepens into night, the distant lights of Night City flicker with neon brilliance.

“How peaceful,” Johnny says sarcastically. “While we wait for the ripperdoc’s AV to arrive, how about doing a couple of indefinite integral exercises for practice?”

1. If the result of the indefinite integral x2+ax+2(x+1)(x2+1),dx does not contain an inverse tangent function, then a=?1.\text{ If the result of the indefinite integral }\int \frac{x^2+ax+2}{(x+1)(x^2+1)} , \mathrm{d}x\text{ does not contain an inverse tangent function, then }a=?
》〉Click to expand the solution〈《 Oh, V, did you spot it? At the very least, the great Johnny Silverhand can tell at a glance that this is a rational-function integral. So let us take it step by step.

First, use the method of undetermined coefficients to decompose the original function, just as I mentioned earlier:

x2+ax+2(x+1)(x2+1)=Ax+1+Mx+Nx2+1\frac{x^2+ax+2}{(x+1)(x^2+1)} = \frac{A}{x+1}+\frac{Mx+N}{x^2+1}

Then how do we elegantly determine AA, MM, and NN?

The problem states that the result does not contain an inverse tangent function. Therefore, there cannot be a term of the form tx2+1 (tR)\frac{t}{x^2+1} \ (t \in \mathbb{R}), so we can easily obtain N=0N = 0.

Next, forget all that fancy stuff and just mash everything together:

x2+ax+2(x+1)(x2+1)=(A+M)x2+Mx+A(x+1)(x2+1)\frac{x^2+ax+2}{(x+1)(x^2+1)} = \frac{(A+M)x^2+Mx+A}{(x+1)(x^2+1)}

It is easy to see that A+M=1A+M=1; M=aM=a; and A=2A = 2.

Therefore, a=1a = -1.

What? You’re saying this is just brute-forcing it with raw horsepower? I don’t care. I’ll use whichever method is easiest.

2.x+1+2(x+1)2x+1,dx=?2. \int \frac{\sqrt{x+1}+2}{(x+1)^2-\sqrt{x+1}} , \mathrm{d}x =?
》〉Click to expand the solution〈《 V, do you remember that somewhere in a forgotten corner above, we said this?

When the integrand contains ax+bn\sqrt[n]{ax + b}, we can set t=ax+bnt = \sqrt[n]{ax + b}, so that x=1a(tnb)x = \frac{1}{a}(t^n - b).

Now is the time to use it!

Let t=x+1t = \sqrt{x+1}. Then x=t2+1x = t^2 + 1, so dx=2tdt\mathrm{d}x = 2t\mathrm{d}t. Thus:

I=t+2t4t2t,dt =2t+2t31,dt\begin{aligned} \text{I} &= \int \frac{t+2}{t^4-t}2t , \mathrm{d}t \ &= 2\int \frac{t+2}{t^3-1} , \mathrm{d}t \end{aligned}

Now this problem has become an integral of a rational function. As usual, we rewrite it as:

Original Expression=2t+2(t1)(t2+t+1),dt =2(1t1t+1t2+t+1),dt\begin{aligned} \text{Original Expression} &= 2\int \frac{t+2}{(t-1)(t^2+t+1)} , \mathrm{d}t \ &= 2\int (\frac{1}{t-1} - \frac{t+1}{t^2+t+1}) , \mathrm{d}t \end{aligned}

What do we do next? Our general idea is to complete the denominator and integrate directly.

We notice that there is a standalone t+1t+1. Can we use it to construct (t2+t+1)(t^2 + t + 1)'?

All right, let us get to work:

Original Expression=21t1,dt122t+2t2+t+1,dt =21t1,dt122t+1t2+t+1,dt1t2+t+1,dt =21t1,dt12d(t2+t+1)t2+t+1d(t+12)(t+12)2+(32)2 =2lnt1lnt2+t+123arctan2t+13+C\begin{aligned} \text{Original Expression} &= 2\int \frac{1}{t-1} , \mathrm{d}t - \frac{1}{2} \int \frac{2t+2}{t^2+t+1} , \mathrm{d}t\ &= 2\int \frac{1}{t-1} , \mathrm{d}t - \frac{1}{2} \int \frac{2t+1}{t^2+t+1} , \mathrm{d}t - \int \frac{1}{t^2+t+1} , \mathrm{d}t \ &= 2\int \frac{1}{t-1} , \mathrm{d}t - \frac{1}{2} \int \frac{\mathrm{d}(t^2+t+1)}{t^2+t+1} - \int \frac{\mathrm{d}(t+\frac{1}{2})}{(t+\frac{1}{2})^2 + (\frac{\sqrt3}{2})^2} \ &=2\ln|t-1|-\ln|t^2+t+1|-\frac{2}{\sqrt3}\arctan{\frac{2t+1}{\sqrt{3}}}+C \end{aligned}

Finally, substitute t=x+1t = \sqrt{x+1} to obtain the answer.

3.I1=cos4x,dx=?, I2=sin4x,dx=?3. I_1=\int\cos^4x,\mathrm{dx}=?, \ I_2=\int\sin^4x,\mathrm{dx}=?
》〉Click to expand the solution〈《

Hmmm… V, this problem looks a little suspicious, doesn’t it?

I bet you racked your brains and still could not figure out how to integrate cos4x,dx\int\cos^4x,\mathrm{dx}.

What? You actually solved it 😧?! Damn it. Back then, I spent over an hour trying to figure out how to complete d(tanx)\mathrm{d}(\tan x) 😩. Fine, let us compare answers.

We need to break out of our usual way of thinking. This problem has two variables, I1I_1 and I2I_2. Add them together:

I1+I2=[(sin2x+cos2x)212sin22x],dx =34x+116sin4x+C1\begin{aligned} I_1 + I_2 &= \int [(\sin^2x+\cos^2x)^2 - \frac{1}{2}\sin^22x] , \mathrm{d}x \ &= \frac{3}{4}x+\frac{1}{16}\sin4x +C_1 \end{aligned}

Similarly, subtracting them gives:

I1I2=12sin2x+C2I_1 - I_2 = \frac{1}{2}\sin2x + C_2

Then it is easy to obtain:

I1=12[(I1+I2)+(I1I2)]=38x+132sin4x+14sin2x+C3 I2=12[(I1+I2)(I1I2)]=38x+132sin4x14sin2x+C4I_1 = \frac{1}{2}[(I_1+I_2) + (I_1 - I_2)] = \frac{3}{8}x+\frac{1}{32}\sin4x + \frac{1}{4}\sin2x +C_3 \ I_2 = \frac{1}{2}[(I_1+I_2) - (I_1 - I_2)] = \frac{3}{8}x+\frac{1}{32}\sin4x - \frac{1}{4}\sin2x +C_4

Note that the two arbitrary constants CC are not necessarily equal.


Final Notes

Thank you so much for reading this far! This is my first attempt at writing a math-related blog post. If there are any oversights or mistakes, I would greatly appreciate it if you could discuss them and point them out in the comments section. 🙏🫪