diff --git a/Estudos/Cálculo/.vscode/settings.json b/Estudos/Cálculo/.vscode/settings.json new file mode 100644 index 0000000..ba2a6c0 --- /dev/null +++ b/Estudos/Cálculo/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python-envs.defaultEnvManager": "ms-python.python:system", + "python-envs.pythonProjects": [] +} \ No newline at end of file diff --git a/Estudos/Cálculo/3_graph.py b/Estudos/Cálculo/3_graph.py new file mode 100644 index 0000000..eebf9a0 --- /dev/null +++ b/Estudos/Cálculo/3_graph.py @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.pyplot as plt + + +# f(x) = sqrt(2(x^2 - 8)) + x, for x < -4 +# f(x) = 2^(x+4), for x >= -4 + +x1 = np.linspace(-12, -4, 500, endpoint=False) +y1 = np.sqrt(2 * (x1**2 - 8)) + x1 + +x2 = np.linspace(-4, 4, 500) +y2 = 2 ** (x2 + 4) + +plt.figure(figsize=(8, 5)) +plt.plot(x1, y1, label=r"$f(x)=\sqrt{2(x^2-8)}+x$, $x<-4$", color="tab:blue") +plt.plot(x2, y2, label=r"$f(x)=2^{x+4}$, $x\\ge -4$", color="tab:orange") + +# Open circle at x = -4 for first branch +y_left_limit = np.sqrt(2 * ((-4) ** 2 - 8)) - 4 +plt.scatter(-4, y_left_limit, facecolors="white", edgecolors="tab:blue", s=80, zorder=5) + +# Closed circle at x = -4 for second branch +y_at_minus4 = 2 ** (0) +plt.scatter(-4, y_at_minus4, color="tab:orange", s=80, zorder=5) + +plt.axhline(0, color="black", linewidth=0.8) +plt.axvline(0, color="black", linewidth=0.8) +plt.grid(True, linestyle="--", alpha=0.5) +plt.xlim(-12, 4) +plt.ylim(-2, max(y2) * 1.1) +plt.title("Graph of the piecewise function f(x)") +plt.xlabel("x") +plt.ylabel("f(x)") +plt.legend() +plt.tight_layout() +plt.show() diff --git a/Estudos/Cálculo/Avaliação.md b/Estudos/Cálculo/Avaliação.md index 90e012d..13d62e3 100644 --- a/Estudos/Cálculo/Avaliação.md +++ b/Estudos/Cálculo/Avaliação.md @@ -24,6 +24,5 @@ $$ y'=\small \dfrac{7}{2}. x^2\sqrt{x}+5x^4 $$ # 3. -$$ -\s -$$ \ No newline at end of file +$f(x) = \sqrt{2(x^2 - 8)}+x$ se $x<-4$ +$f(x) = 2^{x+4}$ se $x\ge-4$