微分公式
-
$y = x^n$ のとき
$\frac{dy}{dx} = n x^{n-1}$ -
$y = x^{-n}$ のとき
$\frac{dy}{dx} = - n x^{-n-1} = - \frac{n}{x^{n+1}}$ -
$y = \ln x$ のとき
$y' = \frac{1}{x}$ -
$y = x + \sqrt{a^2 + x^2}$ のとき
$y' = \frac{1}{\sqrt{a^2 + x^2}}$
- $y = \sin(ax)$ → $y' = a \cos(ax)$
- $y = \cos(ax)$ → $y' = - a \sin(ax)$
- $y = \tan x$ → $y' = \sec^2 x$
- $y = \cot x$ → $y' = - \csc^2 x$
- $y = \sec x$ → $y' = \tan x \sec x$
- $y = \csc x$ → $y' = - \cot x \csc x$
-
$y = \sinh^{-1} x$ → $y' = \frac{1}{\sqrt{x^2 + 1}}$
-
$y = \cosh^{-1} x$ → $y' = \frac{1}{\sqrt{x^2 - 1}}$
-
$y = \tanh^{-1} x$ → $y' = \frac{1}{1 - x^2}$
-
$y = \sin^{-1} x$ → $y' = \frac{1}{\sqrt{1 - x^2}}$
-
$y = \cos^{-1} x$ → $y' = -\frac{1}{\sqrt{1 - x^2}}$
-
$y = \tan^{-1} x$ → $y' = \frac{1}{1 + x^2}$
-
$y = \sec^{-1} x$ → $y' = \frac{1}{x \sqrt{x^2 - 1}}$
-
$y = \csc^{-1} x$ → $y' = -\frac{1}{x \sqrt{x^2 - 1}}$
積分公式
-
$\int x^m dx = \frac{1}{m+1} x^{m+1} \quad (m \neq -1)$
-
$\int x^{-m} dx = -\frac{1}{m-1} x^{-m+1} = \frac{1}{1-m} x^{1-m}$
-
$\int e^{ax} dx = \frac{1}{a} e^{ax}$
-
$\int \ln(ax) dx = x \ln(ax) - x$
-
$\int \frac{1}{x} dx = \ln x$
- $\int \frac{dx}{\sqrt{a^2 + x^2}} = \ln \big(x + \sqrt{a^2 + x^2}\big)$
👉 この「微分公式・積分公式」は電験数学や電磁気公式で頻出します。特に
- $\frac{d}{dx} \ln x = 1/x$
- $\frac{d}{dx} \sin^{-1} x = 1/\sqrt{1-x^2}$
- $\int \frac{1}{x} dx = \ln x$
- $\int \frac{1}{\sqrt{a^2+x^2}} dx = \ln(x+\sqrt{a^2+x^2})$
はよく試験問題に直接使われます。
# Program Name: calculus_formulas_demo.py
# Creation Date: 20250823
# Overview: Demonstrate common differentiation and integration formulas with plots
# Usage: Run the script to compute and visualize basic calculus formulas
!pip install numpy matplotlib sympy -q
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
# --- Symbol definitions ---
x = sp.Symbol('x')
a = sp.Symbol('a', positive=True)
# --- Differentiation examples ---
diff_examples = {
"d/dx x^n": sp.diff(x**3, x), # Example with n=3
"d/dx ln(x)": sp.diff(sp.log(x), x),
"d/dx sqrt(a^2 + x^2)": sp.diff(sp.sqrt(a**2 + x**2), x),
"d/dx sin(x)": sp.diff(sp.sin(x), x),
"d/dx cos(x)": sp.diff(sp.cos(x), x),
"d/dx tan(x)": sp.diff(sp.tan(x), x),
"d/dx arcsin(x)": sp.diff(sp.asin(x), x),
"d/dx arccos(x)": sp.diff(sp.acos(x), x),
"d/dx arctan(x)": sp.diff(sp.atan(x), x),
}
print("=== Differentiation Results ===")
for k, v in diff_examples.items():
print(f"{k} = {v}")
# --- Integration examples ---
int_examples = {
"∫ x^m dx (m=2)": sp.integrate(x**2, x),
"∫ e^(2x) dx": sp.integrate(sp.exp(2*x), x),
"∫ 1/x dx": sp.integrate(1/x, x),
"∫ dx/sqrt(a^2+x^2)": sp.integrate(1/sp.sqrt(a**2+x**2), x),
}
print("\n=== Integration Results ===")
for k, v in int_examples.items():
print(f"{k} = {v}")
# --- Plot example: y = ln(x), y = sqrt(a^2 + x^2) ---
X = np.linspace(0.1, 5, 200)
Y1 = np.log(X)
Y2 = np.sqrt(1 + X**2)
plt.plot(X, Y1, label="y = ln(x)")
plt.plot(X, Y2, label="y = sqrt(1 + x^2)")
plt.title("Example Functions")
plt.xlabel("x")
plt.ylabel("y")
plt.legend()
plt.grid(True)
plt.show()