# 微积分浅显入门

using Plots


## 微分 #

g(x) = - 1/3 * x^3 + 2.5x^2

plot(g, 0, 5,
label="",
xlabel = "Time (s)",
ylabel = "Distance (m)",
linewidth=3
)

savefig("/cn/blog/2023-02-26-intro-to-calculus_files/calculus-01.png")


$$s(t) = - \frac{1}{3} x^{3} + \frac{5}{2} x^2$$

\begin{aligned} v(t = 2) & = \frac{s(2 + \Delta t) - s(2)}{\Delta t} \\ & = \frac{- \frac{1}{3} (2 + \Delta t)^{3} + \frac{5}{2} (2 + \Delta t)^2 + \frac{1}{3} 2^{3} - \frac{5}{2} 2^2}{\Delta t}\\ & = \frac{-\frac{1}{3}\Delta t^3 +6 \Delta t + \frac{1}{2} \Delta t^2}{\Delta t} \\ & = -\frac{1}{3}\Delta t^2 + \frac{1}{2} \Delta t + 6 \end{aligned}

(g(2 + 0.01) - g(2))/0.01

6.004966666666434


\begin{aligned} v(t = x) & = \frac{s(x + \Delta t) - s(x)}{\Delta t} \\ & = \frac{- \frac{1}{3} (x + \Delta t)^{3} + \frac{5}{2} (x + \Delta t)^2 + \frac{1}{3} x^{3} - \frac{5}{2} x^2}{\Delta t}\\ & = \frac{- x^2\Delta t - x \Delta t^2 - \frac{1}{3}\Delta t^3 + 5x \Delta t + \frac{5}{2} \Delta t^2}{\Delta t} \\ & = - x^2 - x \Delta t - \frac{1}{3} \Delta t^2 + 5x + \frac{2}{5} \Delta t \end{aligned}

$$s^\prime(x) = - x^2 + 5x$$

f(x) = - x^2 + 5x

plot(f, 0, 5,
label="",
xlabel="Time (in seconds)",
ylabel="Speed ",
linewidth=3
)

savefig("/cn/blog/2023-02-26-intro-to-calculus_files/calculus-02.png")


## 积分 #

$$f(x) = x (5 - x)$$

$$\frac{ds}{dT} = v(T)$$

$$g(x) = -\frac{1}{3}x^3 + \frac{5}{2}x^2 + c$$

$$g(x) = -\frac{1}{3}x^3 + \frac{5}{2}x^2$$

#Math