mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-07-03 15:41:26 +00:00
Compare commits
26 commits
5068ce3ad3
...
0aaaf08173
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aaaf08173 | ||
|
|
715d6c9b7b | ||
|
|
1bb9d56e03 | ||
|
|
5673fc7ddb | ||
|
|
fa0361e205 | ||
|
|
7067e43cb4 | ||
|
|
1901b50062 | ||
|
|
94cbaf7707 | ||
| 6fc3701afd | |||
| be10270230 | |||
|
|
422a16c42d | ||
| c9d1bacec4 | |||
| 6e84ef4884 | |||
| c88a29ad49 | |||
|
|
6d84a49d50 | ||
| 06999dae80 | |||
| eeff9fa4f6 | |||
|
|
e24af4e020 | ||
| 9d4c8d9f76 | |||
| b60b8d8e61 | |||
|
|
2de231cf72 | ||
| 664fa20b0a | |||
| 04aca48a3b | |||
| e34dfefd33 | |||
| b3c5d11859 | |||
| 920ef78865 |
7 changed files with 2112 additions and 775 deletions
1447
package-lock.json
generated
1447
package-lock.json
generated
File diff suppressed because it is too large
Load diff
615
src/blog/en/post-10.md
Normal file
615
src/blog/en/post-10.md
Normal file
|
|
@ -0,0 +1,615 @@
|
|||
---
|
||||
title: "[Study Notes] The Weird Crowbar-Looking Symbol ∫ — Indefinite Integrals"
|
||||
pubDate: 2026-06-02
|
||||
description: 'A bunch of happy college students vs. a weird symbol that looks like a crowbar. Who would win?'
|
||||
author: "Cloverta"
|
||||
image:
|
||||
url: "https://files.seeusercontent.com/2026/06/01/7ggO/pasted-image-1780316784165.webp"
|
||||
alt: "meme"
|
||||
tags: ["Study Notes", "Calculus", "Integrals"]
|
||||
---
|
||||
|
||||
<p style="font-size: 0.85rem;"><i><sub>Content translated by <a href="https://chatgpt.com/">ChatGPT</a>.</sub></i></p>
|
||||
|
||||
## 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.”
|
||||
|
||||
<img src="https://files.seeusercontent.com/2026/06/01/lLx9/pasted-image-1780316213606.webp" alt="pasted-image-1780316213606.webp" style="display: block; margin: 0 auto;"/>
|
||||
|
||||
### 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)=\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(x_1)-f(x_0)=\sum \Delta 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 $x_0$ to $x_1$, we can obtain the change in the function from $x_0$ to $x_1$. In other words, this is the **definite integral** of the derivative function over that interval:
|
||||
$$
|
||||
f(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(x_1) = f(x_0) + \int_{x_0}^{x_1} f'(x) , \mathrm{d}x
|
||||
$$
|
||||
Here, the function value at the starting point, $f(x_0)$, is a constant. If no initial value is specified, we can write it as an arbitrary constant $C$:
|
||||
$$
|
||||
f(x_1) = C + \int_{x_0}^{x_1} f'(x) , \mathrm{d}x
|
||||
$$
|
||||
When we stop using a fixed, known $x_1$ as the upper limit of the definite integral and replace it with a variable $x$, we obtain the **formula for indefinite integrals**:
|
||||
$$
|
||||
\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 $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)=\int_{t_0}^{t}v(u) , \mathrm{d}u
|
||||
$$
|
||||
It represents the displacement from $t_0$ to $t$.
|
||||
|
||||
Suppose we drive for a very short amount of time $\Delta t$. The additional distance travelled can be approximated by:
|
||||
$$
|
||||
\Delta s \approx v(t) \Delta t
|
||||
$$
|
||||
That is:
|
||||
$$
|
||||
\frac{\Delta s}{\Delta t} \approx v(t)
|
||||
$$
|
||||
As $\Delta t → 0$, we can treat the expression above as:
|
||||
$$
|
||||
\frac{\mathrm{d}s}{\mathrm{d}t} = s'(t) = v(t)
|
||||
$$
|
||||
This is the differentiation formula for an integral with a variable upper limit:
|
||||
$$
|
||||
(\int_{t_0}^{t}v(u) , \mathrm{d}u)'=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)=
|
||||
\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)$, then:
|
||||
$$
|
||||
\lim_{x \to 0^+} F'(x) = 1 \
|
||||
\lim_{x \to 0^-} F'(x) = -1
|
||||
$$
|
||||
Therefore, $F'(x)$ jumps from $-1$ to $1$ at $x=0$. However, according to [Darboux's theorem](https://en.wikipedia.org/wiki/Darboux%27s_theorem_%28analysis%29), 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
|
||||
|
||||
<details>
|
||||
<summary>(Click to expand)</summary>
|
||||
|
||||
1. $\displaystyle \int 0,\mathrm{d}x=C$
|
||||
|
||||
2. $\displaystyle \int x^\alpha,\mathrm{d}x=\frac{1}{\alpha+1}x^{\alpha+1}+C \qquad (\alpha\neq -1)$
|
||||
|
||||
3. $\displaystyle \int \frac{1}{x},\mathrm{d}x=\ln |x|+C$
|
||||
|
||||
4. $\displaystyle \int a^x,\mathrm{d}x=\frac{a^x}{\ln a}+C \qquad (a>0,\ a\neq 1)$
|
||||
|
||||
5. $\displaystyle \int e^x,\mathrm{d}x=e^x+C$
|
||||
|
||||
6. $\displaystyle \int \sin x,\mathrm{d}x=-\cos x+C$
|
||||
|
||||
7. $\displaystyle \int \cos x,\mathrm{d}x=\sin x+C$
|
||||
|
||||
8. $\displaystyle \int \sec^2 x,\mathrm{d}x=\tan x+C$
|
||||
|
||||
9. $\displaystyle \int \csc^2 x,\mathrm{d}x=-\cot x+C$
|
||||
|
||||
10. $\displaystyle \int \sec x\tan x,\mathrm{d}x=\sec x+C$
|
||||
|
||||
11. $\displaystyle \int \csc x\cot x,\mathrm{d}x=-\csc x+C$
|
||||
|
||||
12. $\displaystyle \int \frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\arcsin x+C$
|
||||
|
||||
13. $\displaystyle \int \frac{1}{1+x^2},\mathrm{d}x=\arctan x+C$
|
||||
|
||||
14. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{a^2-x^2}}=\arcsin \frac{x}{a}+C$
|
||||
|
||||
15. $\displaystyle \int \frac{\mathrm{d}x}{a^2+x^2}=\frac{1}{a}\arctan \frac{x}{a}+C$
|
||||
|
||||
16. $\displaystyle \int \frac{\mathrm{d}x}{x^2-a^2}=\frac{1}{2a}\ln \left|\frac{x-a}{x+a}\right|+C$
|
||||
|
||||
17. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2+a^2}}=\ln \left(x+\sqrt{x^2+a^2}\right)+C$
|
||||
|
||||
18. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2-a^2}}=\ln \left|x+\sqrt{x^2-a^2}\right|+C$
|
||||
|
||||
19. $\displaystyle \int \sec x,\mathrm{d}x=\ln |\sec x+\tan x|+C$
|
||||
|
||||
20. $\displaystyle \int \csc x,\mathrm{d}x=-\ln |\csc x+\cot x|+C$
|
||||
|
||||
</details>
|
||||
|
||||
“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:
|
||||
$$
|
||||
\frac{\mathrm{d}y}{\mathrm{d}x}=f'(x)
|
||||
$$
|
||||
That is:
|
||||
$$
|
||||
\mathrm{d}y = \mathrm{d}f(x) = f'(x)\mathrm{d}x
|
||||
$$
|
||||
Then it is obvious that:
|
||||
$$
|
||||
\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(\varphi(x))$, we easily obtain:
|
||||
$$
|
||||
F[\varphi(x)]' = F'[\varphi(x)]\varphi'(x) = f[\varphi(x)]\varphi'(x)
|
||||
$$
|
||||
Therefore, integrating it in reverse gives us the formula above.
|
||||
|
||||
<details>
|
||||
<summary>Common Patterns for Completing the Differential (Click to expand)</summary>
|
||||
|
||||
1. $\displaystyle \int f(ax+b),\mathrm{d}x=\frac{1}{a}\int f(ax+b),\mathrm{d}(ax+b)$
|
||||
|
||||
2. $\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. $\displaystyle \int f(\sqrt{x})\frac{\mathrm{d}x}{\sqrt{x}}=2\int f(\sqrt{x}),\mathrm{d}(\sqrt{x})$
|
||||
|
||||
4. $\displaystyle \int f(e^x)e^x,\mathrm{d}x=\int f(e^x),\mathrm{d}(e^x)$
|
||||
|
||||
5. $\displaystyle \int f(\ln x)\frac{1}{x},\mathrm{d}x=\int f(\ln x),\mathrm{d}(\ln x)$
|
||||
|
||||
6. $\displaystyle \int f(\sin x)\cos x,\mathrm{d}x=\int f(\sin x),\mathrm{d}(\sin x)$
|
||||
|
||||
7. $\displaystyle \int f(\cos x)\sin x,\mathrm{d}x=-\int f(\cos x),\mathrm{d}(\cos x)$
|
||||
|
||||
8. $\displaystyle \int f(\tan x)\frac{1}{\cos^2 x},\mathrm{d}x=\int f(\tan x),\mathrm{d}(\tan x)$
|
||||
|
||||
9. $\displaystyle \int f(\arcsin x)\frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\int f(\arcsin x),\mathrm{d}(\arcsin x)$
|
||||
|
||||
10. $\displaystyle \int f(\arctan x)\frac{1}{1+x^2},\mathrm{d}x=\int f(\arctan x),\mathrm{d}(\arctan x)$
|
||||
|
||||
</details>
|
||||
|
||||
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:
|
||||
$$
|
||||
\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 = \phi(t)$ to replace $x$ in the integral.
|
||||
|
||||
The three most commonly used substitutions are:
|
||||
|
||||
#### 1. Trigonometric Substitution
|
||||
|
||||
1. If the integrand has $\sqrt{a^2-x^2}$, set $x = a \sin t$ or $x = a \cos t$.
|
||||
|
||||
2. If the integrand has $\sqrt{a^2+x^2}$, set $x = a \tan t$.
|
||||
|
||||
3. If the integrand has $\sqrt{x^2 - a^2}$, set $x = a \sec t$.
|
||||
|
||||
Then for the integral above, we can immediately spot the solution. Substituting $x = a \sin t$ gives:
|
||||
$$
|
||||
\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 $\sqrt[n]{ax + b}$, we can set $t = \sqrt[n]{ax + b}$, so that $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 = \frac{1}{t}$.
|
||||
|
||||
### 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:
|
||||
$$
|
||||
\int uv',\mathrm{d}x = \int (uv)' - u'v , \mathrm{d}x
|
||||
$$
|
||||
Rewriting gives:
|
||||
$$
|
||||
\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?
|
||||
$$
|
||||
\int \frac{1}{1+x^2} , \mathrm{d}x = \arctan x + C
|
||||
$$
|
||||
Now, what about:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
\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 $\int R(\sin x, \cos x) , \mathrm{d}x$ (including $\sin^n x \cdot \cos^m x$), we can consider the following substitutions:
|
||||
|
||||
* If $\sin x$ is raised to an odd power and $\cos x$ to an even power, try to extract $\mathrm{d}(\cos x)$ or $\mathrm{d}(\sec x)$.
|
||||
|
||||
* If $\sin x$ is even and $\cos x$ is odd, try to extract $\mathrm{d}(\sin x)$ or $\mathrm{d}(\csc x)$.
|
||||
|
||||
* If both $\sin x$ and $\cos x$ are odd/even, try to extract $\mathrm{d}(\tan x)$ or $\mathrm{d}(\cot x)$.
|
||||
|
||||
Now consider:
|
||||
$$
|
||||
\int \frac{1}{3+\sin^2x} \mathrm{d}x = ?
|
||||
$$
|
||||
With sharp attention, we notice that $\sin x$ has power 2, and $\cos x$ has power 0. So both $\sin x$ and $\cos x$ are even powers. Then we try to form $\mathrm{d}(\tan x)$ or $\mathrm{d}(\cot x)$. How?
|
||||
|
||||
We notice the integrand contains $\sin x$, so to extract the target expression…
|
||||
|
||||
Divide both numerator and denominator by $\cos^2 x$:
|
||||
$$
|
||||
\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 $\sec^2 x$ and $\tan x$ are suspiciously convenient.
|
||||
|
||||
Exactly. Then:
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{Original Integral}
|
||||
&= \int \frac{(\tan x)'}{3(\tan^2 x + 1) + \tan^2x} , \mathrm{d}x
|
||||
\end{aligned}
|
||||
$$
|
||||
Whoa, tricky!
|
||||
|
||||
$$
|
||||
\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 $2\tan x = u$, then:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
\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 $\frac{P(x)}{Q(x)} = \frac{P(x)}{c_0(x-a)^k(x^2+px+q)^l}$, where $k$ and $l$ are positive integers and $p^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:
|
||||
$$
|
||||
\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 🌰:
|
||||
$$
|
||||
\text{Find }\int \frac{x-3}{(x-1)(x^2 - 1)} , \mathrm{d}x
|
||||
$$
|
||||
It is not difficult to obtain:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
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)^2 \
|
||||
D=-1
|
||||
$$
|
||||
Next, set $x=0$ and substitute $D = -1$:
|
||||
$$
|
||||
-3 = B - 1\
|
||||
B=-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:
|
||||
$$
|
||||
\text{Find } \int \frac{x-3}{(x-1)(x^2-1)} , \mathrm{d}x
|
||||
$$
|
||||
It is easy to see that:
|
||||
$$
|
||||
\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+1$. This gives:
|
||||
$$
|
||||
\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=-1$ to delete both of those chunks on the right-hand side! Thus:
|
||||
$$
|
||||
\frac{-1-3}{(-1-1)^2} = 0 + D \
|
||||
D = -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.
|
||||
|
||||
Multiply both sides by $x$ and let $x \to ∞$:
|
||||
$$
|
||||
\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+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.\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=?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉Click to expand the solution〈《</summary>
|
||||
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:
|
||||
$$
|
||||
\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 $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 $\frac{t}{x^2+1} \ (t \in \mathbb{R})$, so we can easily obtain $N = 0$.
|
||||
|
||||
Next, forget all that fancy stuff and just mash everything together:
|
||||
$$
|
||||
\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=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.
|
||||
|
||||
</details>
|
||||
|
||||
$$
|
||||
2. \int \frac{\sqrt{x+1}+2}{(x+1)^2-\sqrt{x+1}} , \mathrm{d}x =?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉Click to expand the solution〈《</summary>
|
||||
V, do you remember that somewhere in a forgotten corner above, we said this?
|
||||
|
||||
> When the integrand contains $\sqrt[n]{ax + b}$, we can set $t = \sqrt[n]{ax + b}$, so that $x = \frac{1}{a}(t^n - b)$.
|
||||
|
||||
Now is the time to use it!
|
||||
|
||||
Let $t = \sqrt{x+1}$. Then $x = t^2 + 1$, so $\mathrm{d}x = 2t\mathrm{d}t$. Thus:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
\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+1$. Can we use it to construct $(t^2 + t + 1)'$?
|
||||
|
||||
All right, let us get to work:
|
||||
$$
|
||||
\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 = \sqrt{x+1}$ to obtain the answer.
|
||||
|
||||
</details>
|
||||
|
||||
$$
|
||||
3. I_1=\int\cos^4x,\mathrm{dx}=?, \ I_2=\int\sin^4x,\mathrm{dx}=?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉Click to expand the solution〈《</summary>
|
||||
|
||||
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 $\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 $\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, $I_1$ and $I_2$. Add them together:
|
||||
$$
|
||||
\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:
|
||||
$$
|
||||
I_1 - I_2 = \frac{1}{2}\sin2x + C_2
|
||||
$$
|
||||
Then it is easy to obtain:
|
||||
$$
|
||||
I_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 $C$ are not necessarily equal.
|
||||
|
||||
</details>
|
||||
|
||||
<br>
|
||||
|
||||
## 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. 🙏
|
||||
622
src/blog/zh/post-10.md
Normal file
622
src/blog/zh/post-10.md
Normal file
|
|
@ -0,0 +1,622 @@
|
|||
---
|
||||
title: "[学习笔记]奇怪的撬棍符号∫——不定积分篇"
|
||||
pubDate: 2026-06-02
|
||||
description: '一群快乐的大学生vs一个长得像撬棍的奇怪符号,谁会赢?'
|
||||
author: "三叶"
|
||||
image:
|
||||
url: "https://files.seeusercontent.com/2026/06/01/7ggO/pasted-image-1780316784165.webp"
|
||||
alt: "meme"
|
||||
tags: ["学习笔记", "高等数学", "积分"]
|
||||
---
|
||||
|
||||
## 开始之前
|
||||
|
||||
假设你在夜之城的发电站中安放了电磁炸弹,企图通过毁坏发电站产生的冲击波将义体医生所在的飞行艇击落。但问题是,冲击波的威力范围非常巨大,你必须要逃到安全距离才能避免受到波及。可惜的是,由于干扰无人机和NCPD无形的大手,你无法通过卫星地图查看自己的位置,你应该怎么办呢?
|
||||
|
||||
好消息是,你可以记录车子仪表盘上显示的速度曲线,叫惹人厌的强尼帮你计算出表达车速的函数表达式。“这太简单了,v。”强尼说,“我们用不定积分就可以轻松求出时间和行驶路程的函数关系。”
|
||||
|
||||
<img src="https://files.seeusercontent.com/2026/06/01/lLx9/pasted-image-1780316213606.webp" alt="pasted-image-1780316213606.webp" style="display: block; margin: 0 auto;"/>
|
||||
|
||||
### 什么是积分
|
||||
|
||||
首先我们知道,**微分**是把函数切分成极小的变化量,以计算函数在局部的变化规律;而**积分**是微分的对立面,积分将函数极小的变化量一个个累加起来,得到一个整体。
|
||||
|
||||
从抽象的函数角度来看,当我们将函数 $y=f(x)$ 微分后的两个极小变化量 $dy$ 和 $dx$ 相除,便可得到函数在该点的瞬时变化率(导数)
|
||||
$$
|
||||
f'(x)=\frac{\mathrm{d}y}{\mathrm{d}x}
|
||||
$$
|
||||
积分所做的事情,就是将每一小段内产生的微小变化量累加起来,从而得到整体的变化量
|
||||
$$
|
||||
f(x_1)-f(x_0)=\sum \Delta y
|
||||
$$
|
||||
当区间被划分得越来越细时,每一小段内的实际变化量 $Δy$ 可以用微分 $dy$ 表示。那么将 $x_0$ 到 $x_1$ 内的所有微小变化量 $dy$ 累加起来,你就可以获取到从 $x_0$ 到 $x_1$ 的函数变化量,也就是导函数在该区间上的**定积分**:
|
||||
$$
|
||||
f(x_1) - f(x_0)= \int_{x_0}^{x_1} \, dy = \int_{x_0}^{x_1} f'(x) \, \mathrm{d}x
|
||||
$$
|
||||
关于定积分的细节和几何理解我们下一节再仔细聊聊,现在我们把公式移项
|
||||
$$
|
||||
f(x_1) = f(x_0) + \int_{x_0}^{x_1} f'(x) \, \mathrm{d}x
|
||||
$$
|
||||
其中,起点处的函数值 $f(x_0)$ 是一个常数。若不指定初始值,就可以把它写成任意常数 $C$
|
||||
$$
|
||||
f(x_1) = C + \int_{x_0}^{x_1} f'(x) \, \mathrm{d}x
|
||||
$$
|
||||
当我们不以固定的已知 $x_1$ 为定积分上限,而是用变量 $x$ ,那么我们就能得到**不定积分公式**:
|
||||
$$
|
||||
\int f'(x) \, \mathrm{d}x = f(x) + C
|
||||
$$
|
||||
变上限定积分给出一个具体的原函数;不定积分则是在这个原函数的基础上加上任意常数 $C$,表示所有可能的原函数。
|
||||
|
||||
## 不定积分的基本概念
|
||||
|
||||
### 定义
|
||||
|
||||
在引言里我们虽然用一通花里胡哨看也看不懂的方法推出了不定积分公式,但引言毕竟是引言~~就算完全不看也没啥大问题。~~
|
||||
|
||||
所以不定积分有什么用呢?
|
||||
|
||||
> **定义:**$f(x)$的**原函数**的全体称为 $f(x)$ 的**不定积分**。
|
||||
|
||||
没错,不定积分,本质上就是:**已知一个函数的导数,反过来找它原来的函数。**
|
||||
|
||||
相较于微分,微分是把一个函数拆成它的局部变化规律;不定积分是根据局部变化规律,恢复原来的函数。
|
||||
|
||||
### 定理
|
||||
|
||||
“很好,v” 强尼挑起他(自以为)帅气的墨镜 “那你知道为什么f(x)在区间I内连续就必定在区间内存在原函数吗?”
|
||||
|
||||
> **定理**:若 $f(x)$ 在区间 $I$ 上连续,则 $f(x)$ 在区间 $I$ 上一定存在原函数。
|
||||
|
||||
举个例子吧,强尼说,他将视线落回车子的仪表盘。
|
||||
|
||||
我们若定义一个车速与时间相关的函数
|
||||
$$
|
||||
v(t)
|
||||
$$
|
||||
那我们可以轻松定义
|
||||
$$
|
||||
s(t)=\int_{t_0}^{t}v(u) \, \mathrm{d}u
|
||||
$$
|
||||
它表示从 $t_0$ 到 $t$ 的位移。
|
||||
|
||||
那么我们开车经过了一段很短的时间 $\Delta t$ ,那么新增的路程可以近似为
|
||||
$$
|
||||
\Delta s \approx v(t) \Delta t
|
||||
$$
|
||||
即
|
||||
$$
|
||||
\frac{\Delta s}{\Delta t} \approx v(t)
|
||||
$$
|
||||
当 $\Delta t → 0$ 时,就可以将上式看作
|
||||
$$
|
||||
\frac{\mathrm{d}s}{\mathrm{d}t} = s'(t) = v(t)
|
||||
$$
|
||||
即变上限积分的求导公式
|
||||
$$
|
||||
(\int_{t_0}^{t}v(u) \, \mathrm{d}u)'=v(t)
|
||||
$$
|
||||
那么就能说明对任意连续的速度函数 $v(t)$,至少存在一个位置函数 $s(t)$,它的导数正好是 $v(t)$。
|
||||
|
||||
直觉上来讲,我们开车的时候,连续变化的车速让我们在每一小段时间内必定有一个已知的路程增量让我们的路程函数存在。
|
||||
|
||||
那么当 $f(x)$ 不连续时呢?
|
||||
|
||||
> **定理**:$f(x)$ 在区间 $I$ 上有第一类间断点,则 $f(x)$ 在区间 $I$ 上没有原函数。
|
||||
|
||||
其实通过我们高中学习的知识就可以知道,对于
|
||||
$$
|
||||
f(x) = |x|
|
||||
$$
|
||||
$f(x)$ 在 $x=0$ 处不可导。
|
||||
|
||||
直观上理解就是,导数作为函数切线的斜率,在这么一个尖端上不存在切线,那么自然不存在导数。
|
||||
|
||||
那么反过来想,对于
|
||||
$$
|
||||
f(x)=
|
||||
\begin{cases}
|
||||
1, & x \geq 0, \\
|
||||
-1, & x < 0.
|
||||
\end{cases}
|
||||
$$
|
||||
也就不存在原函数。
|
||||
|
||||
如果我们强行假设它有一个原函数 $F(x)$ ,那么
|
||||
$$
|
||||
\lim_{x \to 0^+} F'(x) = 1 \\
|
||||
\lim_{x \to 0^-} F'(x) = -1
|
||||
$$
|
||||
于是,$F'(x)$ 在 $x=0$ 处从 $-1$ 跳到 $1$。但是根据[达布定理](https://zh.wikipedia.org/wiki/%E8%BE%BE%E5%B8%83%E5%AE%9A%E7%90%86),导函数具有介值性,即必须在 $-1$ 到 $1$ 之间存在某一点使其导数取 $0$ ,以及 $-1$ 和 $1$ 之间的其他数值。
|
||||
|
||||
然而在这个 $F'(x)$ 上只能取到 $1$ 和 $-1$ ,因此产生矛盾,所以 $f(x)$ 不存在原函数。
|
||||
|
||||
|
||||
|
||||
## 怎么算不定积分
|
||||
|
||||
“v,现在你已经知道什么是不定积分了,手里拿到一个公式你知道怎么算出来它的原函数吗。”强尼在无人机射出的枪林弹雨中朝你大吼。
|
||||
|
||||
“很简单!”他不知道从哪掏出一片草稿纸。“首先你要放到脑袋里的是……”
|
||||
|
||||
### 不定积分基本公式
|
||||
|
||||
<details>
|
||||
<summary>(点击展开)</summary>
|
||||
|
||||
|
||||
1. $\displaystyle \int 0,\mathrm{d}x=C$
|
||||
|
||||
2. $\displaystyle \int x^\alpha,\mathrm{d}x=\frac{1}{\alpha+1}x^{\alpha+1}+C \qquad (\alpha\neq -1)$
|
||||
|
||||
3. $\displaystyle \int \frac{1}{x},\mathrm{d}x=\ln |x|+C$
|
||||
|
||||
4. $\displaystyle \int a^x,\mathrm{d}x=\frac{a^x}{\ln a}+C \qquad (a>0,\ a\neq 1)$
|
||||
|
||||
5. $\displaystyle \int e^x,\mathrm{d}x=e^x+C$
|
||||
|
||||
6. $\displaystyle \int \sin x,\mathrm{d}x=-\cos x+C$
|
||||
|
||||
7. $\displaystyle \int \cos x,\mathrm{d}x=\sin x+C$
|
||||
|
||||
8. $\displaystyle \int \sec^2 x,\mathrm{d}x=\tan x+C$
|
||||
|
||||
9. $\displaystyle \int \csc^2 x,\mathrm{d}x=-\cot x+C$
|
||||
|
||||
10. $\displaystyle \int \sec x\tan x,\mathrm{d}x=\sec x+C$
|
||||
|
||||
11. $\displaystyle \int \csc x\cot x,\mathrm{d}x=-\csc x+C$
|
||||
|
||||
12. $\displaystyle \int \frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\arcsin x+C$
|
||||
|
||||
13. $\displaystyle \int \frac{1}{1+x^2},\mathrm{d}x=\arctan x+C$
|
||||
|
||||
14. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{a^2-x^2}}=\arcsin \frac{x}{a}+C$
|
||||
|
||||
15. $\displaystyle \int \frac{\mathrm{d}x}{a^2+x^2}=\frac{1}{a}\arctan \frac{x}{a}+C$
|
||||
|
||||
16. $\displaystyle \int \frac{\mathrm{d}x}{x^2-a^2}=\frac{1}{2a}\ln \left|\frac{x-a}{x+a}\right|+C$
|
||||
|
||||
17. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2+a^2}}=\ln \left(x+\sqrt{x^2+a^2}\right)+C$
|
||||
|
||||
18. $\displaystyle \int \frac{\mathrm{d}x}{\sqrt{x^2-a^2}}=\ln \left|x+\sqrt{x^2-a^2}\right|+C$
|
||||
|
||||
19. $\displaystyle \int \sec x,\mathrm{d}x=\ln |\sec x+\tan x|+C$
|
||||
|
||||
20. $\displaystyle \int \csc x,\mathrm{d}x=-\ln |\csc x+\cot x|+C$
|
||||
|
||||
</details>
|
||||
|
||||
“记住,无论你碰到什么样的积分,你的首要任务就是将代数式往这些基本积分公式上凑,明白吗。”强尼将草稿纸塞到你手里。
|
||||
|
||||
### 第一换元积分法
|
||||
|
||||
在微分学习中,我们很清楚
|
||||
$$
|
||||
\frac{\mathrm{d}y}{\mathrm{d}x}=f'(x)
|
||||
$$
|
||||
即
|
||||
$$
|
||||
\mathrm{d}y = \mathrm{d}f(x) = f'(x)\mathrm{d}x
|
||||
$$
|
||||
那么很显然
|
||||
$$
|
||||
\int f[\varphi(x)]\varphi'(x) \, \mathrm{d}x = \int f[\varphi(x)] \, \mathrm{d} \varphi(x) = F[\varphi(x)] + C
|
||||
$$
|
||||
我们也可以从链式求导的角度理解它
|
||||
|
||||
我们对嵌套函数 $F(\varphi(x))$ 求导易得
|
||||
$$
|
||||
F[\varphi(x)]' = F'[\varphi(x)]\varphi'(x) = f[\varphi(x)]\varphi'(x)
|
||||
$$
|
||||
那么反过来对它积分就可得上式。
|
||||
|
||||
<details>
|
||||
<summary>常见的凑微分形式(点击展开)</summary>
|
||||
|
||||
|
||||
1. $\displaystyle \int f(ax+b),\mathrm{d}x=\frac{1}{a}\int f(ax+b),\mathrm{d}(ax+b)$
|
||||
|
||||
2. $\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. $\displaystyle \int f(\sqrt{x})\frac{\mathrm{d}x}{\sqrt{x}}=2\int f(\sqrt{x}),\mathrm{d}(\sqrt{x})$
|
||||
|
||||
4. $\displaystyle \int f(e^x)e^x,\mathrm{d}x=\int f(e^x),\mathrm{d}(e^x)$
|
||||
|
||||
5. $\displaystyle \int f(\ln x)\frac{1}{x},\mathrm{d}x=\int f(\ln x),\mathrm{d}(\ln x)$
|
||||
|
||||
6. $\displaystyle \int f(\sin x)\cos x,\mathrm{d}x=\int f(\sin x),\mathrm{d}(\sin x)$
|
||||
|
||||
7. $\displaystyle \int f(\cos x)\sin x,\mathrm{d}x=-\int f(\cos x),\mathrm{d}(\cos x)$
|
||||
|
||||
8. $\displaystyle \int f(\tan x)\frac{1}{\cos^2 x},\mathrm{d}x=\int f(\tan x),\mathrm{d}(\tan x)$
|
||||
|
||||
9. $\displaystyle \int f(\arcsin x)\frac{1}{\sqrt{1-x^2}},\mathrm{d}x=\int f(\arcsin x),\mathrm{d}(\arcsin x)$
|
||||
|
||||
10. $\displaystyle \int f(\arctan x)\frac{1}{1+x^2},\mathrm{d}x=\int f(\arctan x),\mathrm{d}(\arctan x)$
|
||||
|
||||
</details>
|
||||
|
||||
看着很眼熟?像这样的积分正在全国各地上演!而你可能就是下一个☝️
|
||||
|
||||
这些积分并不需要专门去背诵,多做些定积分题目自然就会了(逃
|
||||
|
||||
|
||||
|
||||
### 第二换元积分法
|
||||
|
||||
有的时候,现有的式子无法满足我们直接使用第一类换元积分法,比如说这个例子:
|
||||
$$
|
||||
\int \frac{x^2}{\sqrt{a^2-x^2}}\,\mathrm{d}x
|
||||
$$
|
||||
乍一看,这个怎么求啊,别急,这时候我们可以适当选择 $x = \phi(t)$ 来代换掉式子中的 $x$。
|
||||
|
||||
最最常用的变量代换有如下三种:
|
||||
|
||||
#### 1. 三角代换
|
||||
|
||||
(1) 被积函数有 $\sqrt{a^2-x^2}$ ,令 $x = asint$ 或 $acost$。
|
||||
|
||||
(2) 被积函数有 $\sqrt{a^2+x^2}$ ,令 $x = atant$ 。
|
||||
|
||||
(3) 被积函数有 $\sqrt{x^2 - a^2}$ ,令 $x = asect$ 。
|
||||
|
||||
那么上式我们可以一眼丁真,将 $x = asint$ 带入可得
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \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}
|
||||
$$
|
||||
|
||||
接下来的步骤就简单了。
|
||||
|
||||
“三角函数在积分中非常重要。”强尼翘起二郎腿,从兜里掏出一根雪茄。“v,你应该对这类方法多留意一些。”
|
||||
|
||||
真是臭屁。
|
||||
|
||||
#### 2. 根式代换
|
||||
|
||||
当被积函数含有 $\sqrt[n]{ax + b}$ 时,我们可以令 $t = \sqrt[n]{ax + b}$ ,那么这时有 $x = \frac{1}{a}(t^n - b)$ 。
|
||||
|
||||
#### 3. 倒代换
|
||||
|
||||
当被积函数分母的最高次数高于分子的最高次数时,可令 $x = \frac{1}{t}$。
|
||||
|
||||
### 分部积分法
|
||||
|
||||
在我们记忆深处,有某个公式埋藏在这里
|
||||
|
||||
设 $u(x)$ 、 $v(x)$ 均有连续的导数,那么有
|
||||
$$
|
||||
(uv)' = u'v + uv'
|
||||
$$
|
||||
现在我们将它变变形
|
||||
$$
|
||||
uv'= (uv)' - u'v
|
||||
$$
|
||||
接下来对两边同时积分
|
||||
$$
|
||||
\int uv'\,\mathrm{d}x = \int (uv)' - u'v \, \mathrm{d}x
|
||||
$$
|
||||
整理可得
|
||||
$$
|
||||
\int u \, \mathrm{d}v = uv - \int v \, \mathrm{d}u
|
||||
$$
|
||||
没错!这就是大名鼎鼎的**分部积分法**!适用于两个代数式相乘的情况
|
||||
|
||||
“哼,这么简单就推出来了吗。”强尼不屑地弹了弹烟灰,“要是我出生在那个年代,发现者无疑会是我。”
|
||||
|
||||
分部积分法的奇妙之处在于,当你对一大坨乱了吧唧的代数式发愁时,它可以将其转换为非常容易积分的形态。
|
||||
|
||||
还记得这个式子吗:
|
||||
$$
|
||||
\int \frac{1}{1+x^2} \, \mathrm{d}x = \arctan x + C
|
||||
$$
|
||||
那我问你,
|
||||
$$
|
||||
\int \arctan x \, \mathrm{d}x = ?
|
||||
$$
|
||||
“你想破脑袋也没法积出来的” 强尼从鼻子里哼出这句话。
|
||||
|
||||
除非……
|
||||
|
||||
没错!使用分部积分法!
|
||||
|
||||
那么原式可以转为
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= 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}
|
||||
$$
|
||||
哦对的对的,这下子看懂了,那么接下来只要做有基本理函数积分即可
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= 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}
|
||||
$$
|
||||
怎么样,是不是很神奇?!
|
||||
|
||||
|
||||
|
||||
### 三角有理式积分
|
||||
|
||||
“我说过……”
|
||||
|
||||
啊…这个男人又开始了,,,
|
||||
|
||||
“v,三角有理式在不定积分问题中非常重要。”强尼将雪茄指着你。
|
||||
|
||||
如果我们碰到形如 $\int R(\sin x, \cos x) \, \mathrm{d}x$ (含 $\sin^n x \cdot \cos^m x$ )的积分,我们可以考虑用如下换元法。
|
||||
|
||||
- 当函数中 $\sin x$ 奇次,$\cos x$ 偶次,那我们可以考虑凑 $\mathrm{d}(\cos x)$ 或 $\mathrm{d}(\sec x)$
|
||||
|
||||
- 当函数中 $\sin x$ 偶次,$\cos x$ 奇次,那考虑凑 $\mathrm{d}(\sin x)$ 或 $\mathrm{d}(\csc x)$
|
||||
|
||||
- 若 $\sin x$ 和 $\cos x$ 同为奇次/偶次,那么凑 $\mathrm{d}(\tan x)$ 或 $\mathrm{d}(\cot x)$
|
||||
|
||||
那么接下来我们看这道题
|
||||
$$
|
||||
\int \frac{1}{3+\sin^2x} \mathrm{d}(x) = ?
|
||||
$$
|
||||
通过我们惊人的注意力,我们注意到此函数的 $\sin x$ 为 $2$ 次,而 $\cos x$ 为 $0$ 次,那么说明函数中 $\sin x$ 和 $\cos x$ 均为偶次,那我们要考虑凑出 $\mathrm{d}(\tan x)$ 或者 $\mathrm{d}(\cot x)$ ,怎么做呢?
|
||||
|
||||
我们注意到原式中有 $\sin x$,那为了凑出目标代数式……
|
||||
|
||||
就分号上下同时除以 $\cos^2 x$ 吧!
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \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}
|
||||
$$
|
||||
嗯哼,下一步怎么做呢?
|
||||
|
||||
翻阅不定积分基本公式,我们用惊人的注意力注意到 $\sec^2 x$ 和 $\tan x$ 好像有猫腻!
|
||||
|
||||
没错,那么接下来可以
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \int \frac{(\tan x)'}{3(\tan^2 x + 1) + \tan^2x} \, \mathrm{d}x
|
||||
\end{aligned}
|
||||
$$
|
||||
哎哟我,这下子不看懂了吗
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \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}
|
||||
$$
|
||||
为了方便理解,这里我们令 $2\tan x = u$ ,那么有
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \frac{1}{2} \int \frac{1}{(u)^2 + (\sqrt{3})^2} \, \mathrm{d}(u)
|
||||
\end{aligned}
|
||||
$$
|
||||
查阅基本积分公式可得积分结果为
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \frac{1}{2\sqrt3}\arctan(\frac{u}{\sqrt3}) + C \\
|
||||
&= \frac{1}{2\sqrt3}\arctan(\frac{2\tan x}{\sqrt3}) + C
|
||||
\end{aligned}
|
||||
$$
|
||||
|
||||
|
||||
### 有理函数积分
|
||||
|
||||
“光知道三角函数可不行,v,三角函数会让你的脑袋变得尖尖的。”
|
||||
|
||||
“想成为夜之城真正的积佬,你必须还能应对有理函数的积分。”
|
||||
|
||||
> **定理:**对于形如 $\frac{P(x)}{Q(x)} = \frac{P(x)}{c_0(x-a)^k(x^2+px+q)^l}$ 的有理真分式 ($k$, $l$为正整数, $p^2-4q < 0$),可以唯一地分解为有限个最简有理分式之和。
|
||||
|
||||
即可以分解为
|
||||
$$
|
||||
\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}
|
||||
$$
|
||||
这个时候式子里就只剩下最简的代数式了,我们只需要依次对他们求积分就行了……吗?
|
||||
|
||||
“nonono,上面的待定系数可没那么好求。”强尼冷笑地解释道。
|
||||
|
||||
“和在一起力大飞砖算多项式吗,别傻了,像我们这样的情况,每一秒都非常珍贵,我们没有那么多时间来算这些东西。”
|
||||
|
||||
“那么就由大名鼎鼎的我来告诉你应该怎么应对这样的情况吧😎☝️”
|
||||
|
||||
#### 特殊解法一:x代入特殊值
|
||||
|
||||
争取每代入一个值,都仅剩一个系数
|
||||
|
||||
举个栗子🌰
|
||||
$$
|
||||
求\int \frac{x-3}{(x-1)(x^2 - 1)} \, \mathrm{d}x
|
||||
$$
|
||||
那么我们不难得出
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= \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}
|
||||
$$
|
||||
即,我们需要计算出
|
||||
$$
|
||||
x - 3 = (Ax+B)(x+1) + D(x-1)^2
|
||||
$$
|
||||
通过我们惊人的注意力,我们可以先令 $x = -1$,那么可得
|
||||
$$
|
||||
-1-3=D(-1-1)^2 \\
|
||||
D=-1
|
||||
$$
|
||||
之后令 $x=0$ 那么同时把 $D = -1$ 代入可得
|
||||
$$
|
||||
-3 = B - 1\\
|
||||
B=-2
|
||||
$$
|
||||
最后随便代个 $x = 1$ 可得 $A = 1$。
|
||||
|
||||
#### 特殊解法二:留数法+求x->∞的极限
|
||||
|
||||
我们来看这道题
|
||||
$$
|
||||
求 \int \frac{x-3}{(x-1)(x^2-1)} \, \mathrm{d}x
|
||||
$$
|
||||
易知
|
||||
$$
|
||||
\frac{x-3}{(x-1)(x^2-1)} = \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{D}{x+1}
|
||||
$$
|
||||
首先我们可以两边同时乘 $x+1$,那么就能得到
|
||||
$$
|
||||
\frac{x-3}{(x-1)^2} = [\frac{A}{x-1} + \frac{B}{(x-1)^2}](x+1) + D
|
||||
$$
|
||||
这时候眼尖的小伙伴们就发现了,我们仅需令 $x=-1$ 就能把右边的两坨东西删掉!即
|
||||
$$
|
||||
\frac{-1-3}{(-1-1)^2} = 0 + D \\
|
||||
D = -2
|
||||
$$
|
||||
那剩下的A和B怎么办呢?
|
||||
|
||||
B我们可以如法炮制,两边同时乘 $(x-1)^2$ ,可以算出 $B = -1$。
|
||||
|
||||
那么A怎么算呢?
|
||||
|
||||
这时候请极限法出场。
|
||||
|
||||
左右两边同时乘 $x$ 并令 $x \to ∞$。
|
||||
$$
|
||||
\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}
|
||||
$$
|
||||
那么根据求极限的结果,我们不难得出
|
||||
$$
|
||||
0=A+0+D
|
||||
$$
|
||||
带入 $D = -1$ 得 $A=1$。
|
||||
|
||||
|
||||
|
||||
## 在那之后
|
||||
|
||||
“好,到这里应该OK了。”强尼朝你喊道。你们的车停在山头上,在这里可以俯瞰整个发电站,一座座高耸入云的尖塔整齐排列。傍晚渐浓的夜色中,远处的夜之城闪烁着霓虹的光芒。
|
||||
|
||||
“真是宁静”强尼揶揄道“在我们等待义体医生的飞船来之前,不如先做两道不定积分练练手吧”。
|
||||
$$
|
||||
1.若不定积分\int \frac{x^2+ax+2}{(x+1)(x^2+1)} \, \mathrm{d}x的结果中不含反正切函数,则a=?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉点击展开查看解析〈《</summary>
|
||||
哦v你看出来了吗,至少伟大的强尼银手能一眼看出,这是一道有理数积分问题,那么让我们先按部就班地走。
|
||||
|
||||
先用待定系数法将原函数分解,就像前面我提到的一样。
|
||||
$$
|
||||
\frac{x^2+ax+2}{(x+1)(x^2+1)} = \frac{A}{x+1}+\frac{Mx+N}{x^2+1}
|
||||
$$
|
||||
那么怎么优雅地求 $A$ , $M$ 和 $N$ 呢?
|
||||
|
||||
题目中提到了结果不含正切函数,那么必然不会出现形如 $\frac{t}{x^2+1} (t \in \mathbb{R})$ 的项,因此可以轻易得到 $N = 0$。
|
||||
|
||||
接下来我们管你这那的直接和到一起去,得到
|
||||
$$
|
||||
\frac{x^2+ax+2}{(x+1)(x^2+1)} = \frac{(A+M)x^2+Mx+A}{(x+1)(x^2+1)}
|
||||
$$
|
||||
易知 $A+M=1$ ; $M=a$ ;$A = 2$,
|
||||
|
||||
那么 $a = -1$。
|
||||
|
||||
什么?你说这是在力大飞砖?我管你这那的哪个简单我用哪个。
|
||||
</details>
|
||||
|
||||
|
||||
$$
|
||||
2. \int \frac{\sqrt{x+1}+2}{(x+1)^2-\sqrt{x+1}} \, \mathrm{d}x =?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉点击展开查看解析〈《</summary>
|
||||
v,还记不记得,我们在上面的某个零人在意的角落里说过这么一句话
|
||||
|
||||
>当被积函数含有 $\sqrt[n]{ax + b}$ 时,我们可以令 $t = \sqrt[n]{ax + b}$ ,那么这时有 $x = \frac{1}{a}(t^n - b)$ 。
|
||||
|
||||
现在就是使用它的时候!
|
||||
|
||||
我们令 $t = \sqrt{x+1}$ ,则 $x = t^2 + 1$ ,那么 $\mathrm{d}x = 2t\mathrm{d}t$,于是
|
||||
$$
|
||||
\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}
|
||||
$$
|
||||
那么现在这道题就是一道有理函数积分,按照惯例我们将其化为
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= 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}
|
||||
$$
|
||||
接下来怎么办呢?我们的大致思路是:凑出分母,并直接积分。
|
||||
|
||||
观察到有一个单独的 $t+1$,那我们是不是可以凑出 $(t^2 + t + 1)'$ ?
|
||||
|
||||
好,那我们开始行动。
|
||||
$$
|
||||
\begin{aligned}
|
||||
\text{原式}
|
||||
&= 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}
|
||||
$$
|
||||
最后将 $t = \sqrt{x+1}$ 代入可得出答案
|
||||
</details>
|
||||
|
||||
|
||||
$$
|
||||
3. I_1=\int\cos^4x\,\mathrm{dx}=?, \ I_2=\int\sin^4x\,\mathrm{dx}=?
|
||||
$$
|
||||
|
||||
<details>
|
||||
<summary>》〉点击展开查看解析〈《</summary>
|
||||
|
||||
Hmmm... v,这道题看起来有点蹊跷不是吗。
|
||||
|
||||
我猜你一定想破脑袋也没想出来 $\int\cos^4x\,\mathrm{dx}$ 到底怎么积分。
|
||||
|
||||
什么?你居然做出来了😧?!可恶,当时我可是想了一个多小时怎么凑出 $\mathrm{d}(\tan x)$ 来😩,好吧,那我们来对对答案。
|
||||
|
||||
我们需要跳出以往的惯性思维。这道题有两个变量 $I_1$ 和 $I_2$,那我们将他们相加得
|
||||
$$
|
||||
\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}
|
||||
$$
|
||||
同理我们将他们俩相减可得
|
||||
$$
|
||||
I_1 - I_2 = \frac{1}{2}\sin2x + C_2
|
||||
$$
|
||||
那么就很容易得到
|
||||
$$
|
||||
I_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
|
||||
$$
|
||||
注意两个任意常数 $C$ 未必相等。
|
||||
|
||||
</details>
|
||||
|
||||
<br>
|
||||
|
||||
## 写在最后
|
||||
|
||||
非常感谢你能看到这里!这是我第一次尝试写数学类的博文,如有疏忽错误之处,还恳请在评论区中讨论指正。🙏
|
||||
|
|
@ -15,6 +15,10 @@ export default {
|
|||
writtenBy: "Written by",
|
||||
comments: "Comments",
|
||||
publishedOn: "Published on",
|
||||
commentsDesc: [
|
||||
"Feel free to leave your thoughts here. 💭💡",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
theme: {
|
||||
toggle: "Toggle theme",
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ export default {
|
|||
writtenBy: "作者",
|
||||
comments: "评论",
|
||||
publishedOn: "发布于",
|
||||
commentsDesc: [
|
||||
"欢迎在这里留下你的想法。💭💡",
|
||||
"你可以在登录评论区后,点击文本框右下角的「Subscribe by Email」以通过邮件接收最新的互动通知。"
|
||||
]
|
||||
},
|
||||
theme: {
|
||||
toggle: "切换主题",
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ const t = getTranslations(lang);
|
|||
<PostNav post={post} lang={lang} />
|
||||
|
||||
<h2>{comments}</h2>
|
||||
{t.post.commentsDesc.map((line: string) => <p set:html={line} />)}
|
||||
<Remark42Embed slug={slug} />
|
||||
</article>
|
||||
</BaseLayout>
|
||||
|
|
@ -367,4 +368,88 @@ const t = getTranslations(lang);
|
|||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
details {
|
||||
margin: 1.5rem 0;
|
||||
overflow: hidden;
|
||||
border-top: 2px solid #1e3a5f;
|
||||
border-radius: 0 0 0.5rem 0.5rem;
|
||||
background: rgba(128, 128, 128, 0.14);
|
||||
}
|
||||
|
||||
details summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.8rem 0.9rem;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
user-select: none;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
details summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
details summary::before {
|
||||
content: "›";
|
||||
display: inline-block;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
details[open] summary::before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* 展开内容 */
|
||||
details > :not(summary) {
|
||||
box-sizing: border-box;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
/* 为列表序号预留空间 */
|
||||
details > ol,
|
||||
details > ul {
|
||||
padding: 0.6rem 1rem 1rem 3rem;
|
||||
}
|
||||
|
||||
details li {
|
||||
margin: 0.8rem 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1.25rem 0;
|
||||
padding: 0.75rem 1rem;
|
||||
border-left: 4px solid var(--deep-red);
|
||||
background: rgba(128, 128, 128, 0.1);
|
||||
border-radius: 0 0.4rem 0.4rem 0;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
blockquote p + p {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
/* 块级公式:超出屏幕时只滚动公式,不撑宽整篇文章 */
|
||||
.katex-display {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
padding: 0.25rem 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* 避免 KaTeX 内部元素强行把父容器撑宽 */
|
||||
.katex-display > .katex {
|
||||
min-width: max-content;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -161,4 +161,112 @@ img {
|
|||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* 避免 Markdown 内容撑宽正文 */
|
||||
.post-article,
|
||||
.post-content {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* 块级公式过长时独立横向滚动 */
|
||||
.post-content .katex-display {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
box-sizing: border-box;
|
||||
padding: 0.25rem 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.post-content .katex-display > .katex {
|
||||
display: inline-block;
|
||||
min-width: max-content;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* =========================
|
||||
Markdown details 下拉栏
|
||||
========================= */
|
||||
|
||||
.post-content details {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin: 1.5rem 0;
|
||||
overflow: hidden;
|
||||
|
||||
border-top: 2px solid #1e3a5f;
|
||||
border-radius: 0 0 0.5rem 0.5rem;
|
||||
background: rgba(128, 128, 128, 0.14);
|
||||
}
|
||||
|
||||
.post-content details summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0.8rem 0.9rem;
|
||||
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
user-select: none;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.post-content details summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.post-content details summary::before {
|
||||
content: "›";
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.post-content details[open] summary::before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.post-content details > :not(summary) {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.post-content details > ol,
|
||||
.post-content details > ul {
|
||||
padding: 0.6rem 1rem 1rem 3rem;
|
||||
}
|
||||
|
||||
.post-content details li {
|
||||
margin: 0.8rem 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1.25rem 0;
|
||||
padding: 0.75rem 1rem;
|
||||
border-left: 4px solid var(--deep-red);
|
||||
background: rgba(128, 128, 128, 0.1);
|
||||
border-radius: 0 0.4rem 0.4rem 0;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
blockquote p + p {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue