不定积分

不定积分

我们已经知道,\(f(x)\) 的所有原函数可以写成 \(\displaystyle C + \int_a^x f(u)\mathrm du\) 的形式。我们将这一形式缩写如下:

\[ \int f(x)\mathrm dx = C + \int_a^x f(u)\mathrm du \]

这被称为 \(f(x)\) 的不定积分。其中 \(C\) 被称为积分常数(万万不能漏)。不定积分实质上是全体原函数的集合,对它的操作视为对所有原函数同时操作。

这个时候,微积分基本定理就更加简洁了:

\[ \begin{aligned} \mathrm d \left(\int f(x) \mathrm dx\right) &= f(x)\mathrm dx\\ \int_a^b f(x)\mathrm dx&= \left.\left(\int f(x) \mathrm dx\right)\right|_a^b \end{aligned} \]

但是,需要注意的是,不定积分中的 \(x\) 是令人迷惑的。它代表的是定积分里变化的上限,而不是定积分里的被积量。

容易遗忘的积分表

  • \(\displaystyle \int \frac {\mathrm dx}{x} = \ln|x| + C\)
  • \(\displaystyle \int \frac{\mathrm dx}{\sqrt{1-x^2}} = \arcsin x + C\)
  • \(\displaystyle \int \frac{-\mathrm dx}{\sqrt{1-x^2}} = \arccos x + C\)
  • \(\displaystyle \int \frac{\mathrm dx}{1+x^2} = \arctan x + C\)

(太容易遗忘以至于我打的时候还打错了)

换元积分法

考虑 \(f(\varphi(x)) \varphi'(x) \mathrm dx = f(\varphi(x))\mathrm d\varphi(x)\)

这一等式实际蕴含了两个换元方法。从左到右被称为换元法则一(凑微分法),从右往左被称为换元法则二。

积分法需要丰富的经验和集中的注意力,我将在下面更多地记录例题和思路。记住,\(\text{Attention Is All You Need}\)

e.g. 1

\[ \begin{aligned} \int \sin 2x \mathrm dx &= \frac 12 \int \sin 2x \mathrm d(2x)&&= -\frac 12 \cos 2x + C \\ &= 2\int \sin x \mathrm d(\sin x)&&= \sin^2 x + C \\ &= -2\int \cos x\mathrm d(\cos x)&&= -\cos^2 x + C \end{aligned} \]

注意三种答案都是对的,其差别隐藏在常数 \(C\) 中。

e.g. 2

\[ \begin{aligned} \int \frac{\mathrm dx}{2x + 3} &= \frac 12\int\frac{\mathrm d(2x)}{2x + 3} \\ &= \frac 12 \ln |2x + 3| + C \end{aligned} \]

一般地,\(\displaystyle\int f(ax +b) \mathrm dx = \frac 1a \left.\int f(u) \mathrm du \right|_{u=ax+b}\)

e.g. 3

\[ \begin{aligned} \int \frac{\mathrm dx}{x\ln x} = \int\frac{\mathrm d(\ln |x|)}{\ln x} = \ln |\ln x| + C \end{aligned} \]

e.g. 4

\[ \begin{aligned} \int \frac{x \mathrm dx}{(x+1)^3} &= \int \frac{\mathrm dx}{(x+1)^2} - \int\frac{\mathrm dx}{(x+1)^3}\\ &= -\frac{1}{x+1}+\frac{1}{2(x+1)^2}+C \end{aligned} \]

e.g. 5

\[ \begin{aligned} \int \frac{\mathrm dx}{a^2+x^2} &= \frac 1a\int \frac{\mathrm d(\frac xa)}{1+(\frac xa)^2}\\ &= \frac 1a \arctan \frac xa + C \end{aligned} \]

e.g. 6

\[ \begin{aligned} \int \frac{\mathrm dx}{a^2 - x^2} &= \int \frac{\mathrm dx}{(a+x)(a-x)}\\ &=\frac 1{2a}\left(\int \frac{\mathrm d(a+x)}{a+x}-\int\frac{\mathrm d(a-x)}{a-x}\right) \\ &= \frac 1{2a}\left(\ln|a+x| - \ln|a-x|\right) + C\\ &= \frac 1{2a}\ln\left|\frac{a+x}{a-x}\right| + C \end{aligned} \]

e.g. 7

\[ \begin{aligned} \int \frac{\mathrm dx}{\sqrt{a^2-x^2}} &= \int\frac{\mathrm{d}\left( \frac{x}{a} \right)}{\sqrt{ 1-\left( \frac{x}{a} \right)^2 }}\\ &= \arcsin \frac{x}{a}+ C \end{aligned} \]

e.g. 8

\[ \begin{aligned} \int \frac{\mathrm dx}{x^2 + 2x + 2} &= \int \frac{\mathrm{d}(x+1)}{(x+1)^2+1} \\ &= \arctan (x+1) + C \end{aligned} \]

e.g. 9

$$ \[\begin{aligned} \int \frac{\mathrm dx}{1 + e^x} &= \int\left(1 - \frac{e^x}{1+e^x}\right) \mathrm{d}x \\ &= x - \int \frac{\mathrm{d}(1+e^x)}{1+e^x} \\ &= x - \ln |1+e^x| + C \end{aligned}\]

$$

e.g. 10

\[ \begin{aligned} \int \left(1-\frac 1{x^2}\right)e^{x+\frac 1x} \mathrm dx &= \int e^{x + \frac 1x}\mathrm{d}\left( x+\frac{1}{x} \right) \\ &= \exp\left( x+\frac{1}{x} \right) \end{aligned} \]

e.g. 11

\[ \begin{aligned} \int \frac{\mathrm dx}{\sqrt{2x+3} + \sqrt{2x-1}} & = \int \frac{\sqrt{ 2x+3 }-\sqrt{ 2x-1 }}{8}\mathrm{d}(2x) \\ & =\frac{1}{12}((2x+3)^{\frac 32} - (2x-1)^\frac 32) + C \end{aligned} \]

e.g. 12

\[ \begin{aligned} \int\frac{\mathrm dx}{1+\cos x} & = \int \frac{1-\cos x}{\sin^2x}\mathrm{d}x & = & \int\frac{\mathrm{d} (\frac{x}{2})}{\cos^2 \frac{x}{2}} \\ & =-\cot x+\frac{1}{\sin x} + C & = & \tan \frac{x}{2} + C \end{aligned} \]

e.g. 13

\[ \begin{aligned} \int \sin^2 x\cos^5 x\mathrm dx & = \int \sin ^2 x (1-\sin^2 x)^2 \mathrm{d} (\sin x) \\ & = \frac{1}{7}\sin^7 x - \frac{2}{5}\sin^5 x + \frac{1}{3}\sin^{3} x \end{aligned} \]

拆奇数次项。

e.g. 14

\[ \begin{aligned} \int \sin^2 x\cos ^4 x \mathrm dx & = \int \frac{\left( 1-\cos 2x \right)\left( 1+\cos 2x \right)^2}{8} \mathrm{d} x \\ & = \frac{1}{8}\left( x +\int \cos 2x\mathrm{d}x - \int \cos^2 2x \mathrm{d} x - \int \cos^3 2x \mathrm{d} x \right) + C \\ & = \frac{1}{8}\left( x + \frac{1}{2}\sin 2x - \int \frac{1+\cos 4x}{2}\mathrm{d}x - \int \frac{\cos 6x + 3 \cos 2x}{4}\mathrm{ d}x \right) + C \\ & = \frac{1}{8}\left( \frac{1}{2}x +\frac{\sin 2x}{8} - \frac{1}{8}\sin 4x - \frac{1}{24} \sin 6x\right) + C \\ & = \frac{1}{192}(12x + 3\sin 2x - 3 \sin 4x - \sin 6x) + C \end{aligned} \]

降幂公式。

这类题的通法如下:有奇数项则拆奇数项,无奇数项使用降幂公式:

\[ \begin{aligned} \sin ^2 x & = \frac{\cos 2x - 1}{2} \\ \cos ^2 x & = \frac{\cos 2x + 1}{2} \end{aligned} \]

此外,三倍角公式有时也可以让答案更简洁:

\[ \begin{aligned} \sin^3 x & = \frac{3\sin x - \sin 3x}{4} \\ \cos^3 x & = \frac{3\cos x+ \cos 3x}{4} \end{aligned} \]

另外,容易出错的是,\(\displaystyle \int \cos ax = \frac{1}{a} \sin x\)。要注意系数 \(\frac{1}{a}\)

e.g. 15

\[ \begin{aligned} \int \cos 5x \cos x \mathrm dx & = \frac{1}{2}\int (\cos 6x + \cos x) \mathrm{d}x\\ & = \frac{1}{12} \sin 6x + \frac{1}{2} \sin x + C \end{aligned} \]

积化和差。

e.g. 16

\[ \begin{aligned} \int \csc x\mathrm dx & = \int\frac{1}{\sin x}\mathrm{d}x & = & \int \frac{\sin x}{\sin^2x}\mathrm{d}x & = & \int \frac{\csc x(\csc x + \cot x)}{\csc x+\cot x}\mathrm{d} x \\ & = \int \frac{\mathrm{d}x}{2\sin \frac{x}{2} \cos \frac{x}{2}} & = & -\int \frac{\mathrm{d}(\cos x)}{1-\cos^2 x} & = & \int \frac{\mathrm{d}(\csc x + \cot x)}{\csc x + \cot x} \\ & =\int \frac{\sec^2 \frac{x}{2}}{\tan \frac{x}{2}}\mathrm{d}\left( \frac{x}{2} \right) & = & -\frac{1}{2}\ln \left|\frac{1+\cos x}{1-\cos x}\right| + C & = & \ln |\csc x + \cot x|+ C \\ & =\ln |\tan \frac{x}{2}| + C \end{aligned} \]

一题多解。

注意一个易错点是 \(\sin x \mathrm{d}x= -\mathrm{d}(\cos x)\),不要忘记负号。

e.g. 17

\(f'(\sin^2 x) = \cos^2 x\),求 \(f(x)\)

注意到 \(\sin^2 x + \cos^2 x = 1\),则 \(f'(x) = 1-x\)

\[ \begin{aligned} f(x) &= \int f'(x) \mathrm{d}x\\ &= x-\frac{1}{2}x^2 + C \end{aligned} \]

e.g. 18

\[ \begin{aligned} \int\frac{\mathrm{d}x}{\sqrt{ 4-x^2 }\arcsin \frac{x}{2}} &= \int \frac{\mathrm{d}\left( \arcsin \frac{x}{2} \right)}{\arcsin \frac{x}{2}} \\ &= \ln \left| \arcsin \frac{x}{2} \right| + C \end{aligned} \]

e.g. 19

\[ \begin{aligned} \int \frac{\mathrm{d}x}{\sqrt{ x^2+a^2 }} &= \int \frac{a\sec^2t\mathrm{d}t}{a\sqrt{ \tan^2t+1 }}\\ &= \int \sec t \mathrm{d}t \\ &= \ln \left| \sec t + \tan t \right| + C\\ &= \ln \left| x + \sqrt{ x^2 + a^2 } \right| + C \end{aligned} \]

三角代换常见公式:

  • \(\sin ^2t + \cos^2t =1\)\(\sin,\cos\) 值域是 \([-1,1]\)
  • \(\tan^2t + 1 = \sec^2t\)\(\tan\) 值域是 \((-\infty,+\infty)\)\(\sec\) 值域是 \((-\infty, -1]\cup[1,+\infty)\)
  • \(\cot^2t + 1 = \csc^2t\)\(\cot\) 值域是 \((-\infty, +\infty)\)\(\csc\) 值域是 \((-\infty, -1]\cup[1,+\infty)\)

另附三角函数的原函数:

  • \(\displaystyle\int \sin x\mathrm{d}x = -\cos x+C\)
  • \(\displaystyle\int \cos x \mathrm{d}x = \sin x+ C\)
  • \(\displaystyle\int \tan x \mathrm{d}x = -\ln \left| \cos x \right|+ C\)
  • \(\displaystyle\int \cot x \mathrm{d}x = \ln \left| \sin x \right|+ C\)
  • \(\displaystyle\int \csc x \mathrm{d}x = -\ln \left| \csc x + \cot x \right|+ C\)
  • \(\displaystyle\int \sec x \mathrm{d}x = \ln \left| \sec x + \tan x \right|+ C\)

注意完整书写时要写明代换方法,确保值域相同,且存在反函数。

e.g. 20

\(\displaystyle \int \frac{\mathrm{d}x}{\sqrt{ x^2-a^2 }}\)

观察发现 \(x\) 有两段定义域,并不连续,所以要分别积分。

\(x>a\) 时,注意到 \(\left| \frac{x}{a} \right| \in (1, +\infty)\),令 \(x = a\sec t\left( t \in \left( 0, \frac{\pi}{2} \right) \right)\)\(\mathrm{d}x = a\sec t\tan t \mathrm{d}t\)\(\sqrt{ x^2 -a^2}=a \tan t\)

则有:

\[ \begin{aligned} \int \frac{\mathrm{d}x}{\sqrt{ x^2-a^2 }} &= \int \sec t \mathrm{d}t\\ &= \ln \left| \sec t + \tan t \right| +C_{1}\\ &= \ln \left| \frac{x}{a} + \sqrt{ \left( \frac{x}{a} \right)^2-1 } \right| + C_{1}\\ &= \ln \left| x + \sqrt{ x^2 - a^2 } \right| + \left.C \right|_{C=C_{1}-\ln a} \end{aligned} \]

\(x<a\) 时,令 \(x=-u\)\(\mathrm{d}x = -\mathrm{d}u\)。则:

\[ \begin{aligned} \int \frac{\mathrm{d}x}{\sqrt{ x^2 - a^2 }}&=-\int \frac{\mathrm{d}u}{\sqrt{ u^2 - a^2 }}\\ &= -\ln \left| -x + \sqrt{ x^2- a^2 } \right| + C_{2} \\ &= -\ln \left| \frac{a^2}{-x-\sqrt{ x^2-a^2 }} \right| + C_{2} \\ &= \ln |x + \sqrt{ x^2 - a^2 }| + \left.C \right|_{C=C_{2} - 2\ln a} \end{aligned} \]

其中第三个等号使用了分子有理化技巧。

此类三角代换目标是换掉根式。出现根式的地方往往要仔细考虑正负。还要注意正负变化时被积函数也许不连续。个人建议分类讨论会比绝对值硬上好很多。

e.g. 21

\(\displaystyle \int \frac{\mathrm{d}x}{\sqrt{ 1+e^x }}\)

考虑如何换掉根式。令 \(t=\sqrt{ 1+e^x }\),则 \(x=\ln(t^2-1)\)\(\mathrm{d}x=\frac{2t}{t^2-1}\mathrm{d}t\)

则有:

\[ \begin{aligned} \int \frac{\mathrm{d}x}{\sqrt{ 1 + e^x }} &= \int \frac{2\mathrm{d}t}{t^2-1}\\ &= \int \frac{\mathrm{d}t}{t-1} - \int \frac{\mathrm{d}t}{t+1}\\ &= \ln \left| \frac{t-1}{t+1} \right| + C\\ &= 2\ln (\sqrt{ 1+e^x } - 1) - x + C \end{aligned} \]

最后一步代换后使用分母有理化。

这个代换为什么可以直接把根式换成 \(t\) 呢?因为根式下出现的是 \(e^x\),而非 \(x^2\),这样,反函数就不会带有根式,进而 \(\mathrm{d}x\) 不会带有根式。而像 \(t=\sqrt{ x^2-1 }\),我们得到 \(x = \sqrt{ t^2 + 1 }\),导致代换后仍有根式,起不到效果。

e.g. 22

\(\displaystyle \int \frac{\cot x}{\sin x + \cos x + 1} \mathrm{d}x\)

考虑 \(t = \tan \frac{x}{2}\),则 \(\sin x = \frac{2t}{1+t^2},\cos x = \frac{1-t^2}{1+t^2},\mathrm{d}x=\frac{2}{1+t^2}\mathrm{d}t\)

那么有:

\[ \begin{aligned} \int \frac{\cot x}{\sin x + \cos x + 1} \mathrm{d}x &= \frac{\frac{1-t^2}{2t}}{\frac{2t+1-t^2+1+t^2}{1+t^2}} \frac{2}{1+t^2}\mathrm{d}t\\ &= \int\frac{1-t}{2t}\mathrm{d}t\\ &= \frac{1}{2}\ln|t| - \frac{1}{2}t + C\\ &= \frac{1}{2}\ln \left| \tan \frac{x}{2} \right| - \frac{1}{2}\tan \frac{x}{2} + C \end{aligned} \]

此即万能代换。