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.”
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) and divide the two infinitesimal changes dy and dx, we obtain the instantaneous rate of change of the function at that point, which is the derivative:
f′(x)=dxdy
What integration does is accumulate the tiny changes produced within each small segment, thereby obtaining the overall change:
f(x1)−f(x0)=∑Δy
As the interval is divided into increasingly finer segments, the actual change Δy within each segment can be represented by the differential dy. By adding up all the infinitesimal changes dy from x0 to x1, we can obtain the change in the function from x0 to x1. In other words, this is the definite integral of the derivative function over that interval:
f(x1)−f(x0)=∫x0x1,dy=∫x0x1f′(x),dx
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),dx
Here, the function value at the starting point, f(x0), is a constant. If no initial value is specified, we can write it as an arbitrary constant C:
f(x1)=C+∫x0x1f′(x),dx
When we stop using a fixed, known x1 as the upper limit of the definite integral and replace it with a variable x, we obtain the formula for indefinite integrals:
∫f′(x),dx=f(x)+C
A definite integral with a variable upper limit gives us one specific antiderivative. An indefinite integral adds an arbitrary constant C 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) is called the indefinite integral of 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) that is continuous on an interval I must have an antiderivative on that interval?”
Theorem: If f(x) is continuous on an interval I, then f(x) must have an antiderivative on the interval I.
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)
Then we can easily define:
s(t)=∫t0tv(u),du
It represents the displacement from t0 to t.
Suppose we drive for a very short amount of time Δt. The additional distance travelled can be approximated by:
Δs≈v(t)Δt
That is:
ΔtΔs≈v(t)
As Δt→0, we can treat the expression above as:
dtds=s′(t)=v(t)
This is the differentiation formula for an integral with a variable upper limit:
(∫t0tv(u),du)′=v(t)
This shows that for any continuous velocity function v(t), there exists at least one position function s(t) whose derivative is exactly 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) is not continuous?
Theorem: If f(x) has a discontinuity of the first kind on an interval I, then f(x) has no antiderivative on the interval I.
In fact, from what we learned in high school, we already know that for:
f(x)=∣x∣
f(x) is not differentiable at x=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,x≥0,−1,x<0.
there is no antiderivative either.
If we forcibly assume that it has an antiderivative F(x), then:
x→0+limF′(x)=1x→0−limF′(x)=−1
Therefore, F′(x) jumps from −1 to 1 at x=0. However, according to Darboux’s theorem, derivatives have the intermediate value property. In other words, there must be some point between −1 and 1 where the derivative takes the value 0, as well as points where it takes the other values between −1 and 1.
However, this F′(x) can only take the values 1 and −1. This produces a contradiction, so 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)
∫0,dx=C
∫xα,dx=α+11xα+1+C(α=−1)
∫x1,dx=ln∣x∣+C
∫ax,dx=lnaax+C(a>0,a=1)
∫ex,dx=ex+C
∫sinx,dx=−cosx+C
∫cosx,dx=sinx+C
∫sec2x,dx=tanx+C
∫csc2x,dx=−cotx+C
∫secxtanx,dx=secx+C
∫cscxcotx,dx=−cscx+C
∫1−x21,dx=arcsinx+C
∫1+x21,dx=arctanx+C
∫a2−x2dx=arcsinax+C
∫a2+x2dx=a1arctanax+C
∫x2−a2dx=2a1lnx+ax−a+C
∫x2+a2dx=ln(x+x2+a2)+C
∫x2−a2dx=lnx+x2−a2+C
∫secx,dx=ln∣secx+tanx∣+C
∫cscx,dx=−ln∣cscx+cotx∣+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:
dxdy=f′(x)
That is:
dy=df(x)=f′(x)dx
Then it is obvious that:
∫f[φ(x)]φ′(x),dx=∫f[φ(x)],dφ(x)=F[φ(x)]+C
We can also understand this from the perspective of the chain rule.
If we differentiate the composite function F(φ(x)), we easily obtain:
F[φ(x)]′=F′[φ(x)]φ′(x)=f[φ(x)]φ′(x)
Therefore, integrating it in reverse gives us the formula above.
Common Patterns for Completing the Differential (Click to expand)
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:
∫a2−x2x2,dx
At first glance, how do we solve this? Don’t panic — here we can pick a suitable substitution x=ϕ(t) to replace x in the integral.
The three most commonly used substitutions are:
1. Trigonometric Substitution
If the integrand has a2−x2, set x=asint or x=acost.
If the integrand has a2+x2, set x=atant.
If the integrand has x2−a2, set x=asect.
Then for the integral above, we can immediately spot the solution. Substituting x=asint gives:
Original Integral=∫acosta2sin2t,d(asint)=∫acosta2sin2t⋅acost,dt=∫a2sin2t,dt
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 nax+b, we can set t=nax+b, so that x=a1(tn−b).
3. Reciprocal Substitution
When the degree of the polynomial in the denominator is higher than in the numerator, we can set x=t1.
Integration by Parts
Somewhere in our memory, there’s a formula buried:
If u(x) and v(x) both have continuous derivatives, then
(uv)′=u′v+uv′
Now we can rearrange:
uv′=(uv)′−u′v
Integrate both sides:
∫uv′,dx=∫(uv)′−u′v,dx
Rewriting gives:
∫u,dv=uv−∫v,du
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?
∫1+x21,dx=arctanx+C
Now, what about:
∫arctanx,dx=?
“You won’t crack this by brute force,” Johnny snorts.
Unless…
Exactly! Use integration by parts!
The integral becomes:
Original Integral=x⋅arctanx−∫x,d(arctanx)=x⋅arctanx−∫x1+x21,dx
Ah, now it makes sense. Then we just use basic integral formulas:
Original Integral=x⋅arctanx+21∫1+x21,d(x2)=x⋅arctanx+21ln(1+x2)
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 (including sinnx⋅cosmx), we can consider the following substitutions:
If sinx is raised to an odd power and cosx to an even power, try to extract d(cosx) or d(secx).
If sinx is even and cosx is odd, try to extract d(sinx) or d(cscx).
If both sinx and cosx are odd/even, try to extract d(tanx) or d(cotx).
Now consider:
∫3+sin2x1dx=?
With sharp attention, we notice that sinx has power 2, and cosx has power 0. So both sinx and cosx are even powers. Then we try to form d(tanx) or d(cotx). How?
We notice the integrand contains sinx, so to extract the target expression…
Divide both numerator and denominator by cos2x:
Original Integral=∫3sec2x+cos2xsin2xsec2x,dx=∫3sec2x+tan2xsec2x,dx
Next step?
Check the basic integral formulas — notice sec2x and tanx are suspiciously convenient.
Exactly. Then:
Original Integral=∫3(tan2x+1)+tan2x(tanx)′,dx
Whoa, tricky!
Original Integral=∫4tan2x+31,d(tanx)=21∫(2tanx)2+(3)21,d(2tanx)
For convenience, let 2tanx=u, then:
Original Integral=21∫u2+(3)21,du
Using the basic formula, the integral evaluates to:
Original Integral=231arctan(3u)+C=231arctan(32tanx)+C
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 Q(x)P(x)=c0(x−a)k(x2+px+q)lP(x), where k and l are positive integers and p2−4q<0, can be uniquely decomposed into the sum of a finite number of partial fractions in their simplest forms.
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 ∫(x−1)(x2−1)x−3,dx
It is not difficult to obtain:
Original Expression=(x−1)2Ax+B+x+1D=(x−1)2(x+1)(Ax+B)(x+1)+D(x−1)2
That is, we need to calculate:
x−3=(Ax+B)(x+1)+D(x−1)2
Using our astonishing powers of observation, we can first set x=−1. Then:
−1−3=D(−1−1)2D=−1
Next, set x=0 and substitute D=−1:
−3=B−1B=−2
Finally, just substitute x=1, and we obtain A=1.
Special Method 2: The Residue Method + Taking the Limit as x -> ∞
Consider this problem:
Find ∫(x−1)(x2−1)x−3,dx
It is easy to see that:
(x−1)(x2−1)x−3=x−1A+(x−1)2B+x+1D
First, multiply both sides by x+1. This gives:
(x−1)2x−3=[x−1A+(x−1)2B](x+1)+D
At this point, sharp-eyed readers will notice that we only need to set x=−1 to delete both of those chunks on the right-hand side! Thus:
(−1−1)2−1−3=0+DD=−2
Then what about the remaining A and B?
We can deal with B in the same way: multiply both sides by (x−1)2, and we obtain B=−1.
Then how do we calculate A?
It is time for the limit method to enter the stage.
Based on the resulting limits, it is not difficult to obtain:
0=A+0+D
Substituting D=−1 gives A=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 ∫(x+1)(x2+1)x2+ax+2,dx 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:
(x+1)(x2+1)x2+ax+2=x+1A+x2+1Mx+N
Then how do we elegantly determine A, M, and N?
The problem states that the result does not contain an inverse tangent function. Therefore, there cannot be a term of the form x2+1t(t∈R), so we can easily obtain N=0.
Next, forget all that fancy stuff and just mash everything together:
(x+1)(x2+1)x2+ax+2=(x+1)(x2+1)(A+M)x2+Mx+A
It is easy to see that A+M=1; M=a; and A=2.
Therefore, a=−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+1x+1+2,dx=?》〉Click to expand the solution〈《
V, do you remember that somewhere in a forgotten corner above, we said this?
When the integrand contains nax+b, we can set t=nax+b, so that x=a1(tn−b).
Now is the time to use it!
Let t=x+1. Then x=t2+1, so dx=2tdt. Thus:
I=∫t4−tt+22t,dt=2∫t3−1t+2,dt
Now this problem has become an integral of a rational function. As usual, we rewrite it as:
Original Expression=2∫(t−1)(t2+t+1)t+2,dt=2∫(t−11−t2+t+1t+1),dt
What do we do next? Our general idea is to complete the denominator and integrate directly.
We notice that there is a standalone t+1. Can we use it to construct (t2+t+1)′?
All right, let us get to work:
Original Expression=2∫t−11,dt−21∫t2+t+12t+2,dt=2∫t−11,dt−21∫t2+t+12t+1,dt−∫t2+t+11,dt=2∫t−11,dt−21∫t2+t+1d(t2+t+1)−∫(t+21)2+(23)2d(t+21)=2ln∣t−1∣−ln∣t2+t+1∣−32arctan32t+1+C
Finally, substitute t=x+1 to obtain the answer.
3.I1=∫cos4x,dx=?,I2=∫sin4x,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.
What? You actually solved it 😧?! Damn it. Back then, I spent over an hour trying to figure out how to complete d(tanx) 😩. Fine, let us compare answers.
We need to break out of our usual way of thinking. This problem has two variables, I1 and I2. Add them together:
Note that the two arbitrary constants C 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. 🙏
After signing in, you can click the “Subscribe by Email” button at the bottom right of the text box to receive notifications of new interactions via email.