use quarto, not Pluto to render pages
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
In this section we use the following add-on packages:
|
||||
|
||||
|
||||
```julia
|
||||
using SymPy
|
||||
using Plots
|
||||
@@ -11,6 +12,8 @@ using Plots
|
||||
using CalculusWithJulia
|
||||
using CalculusWithJulia.WeaveSupport
|
||||
|
||||
fig_size = (800, 600) #400, 300)
|
||||
|
||||
const frontmatter = (
|
||||
title = "Polynomials",
|
||||
description = "Calculus with Julia: Polynomials",
|
||||
@@ -19,6 +22,7 @@ const frontmatter = (
|
||||
nothing
|
||||
```
|
||||
|
||||
|
||||
----
|
||||
|
||||
Polynomials are a particular class of expressions that are simple
|
||||
@@ -57,7 +61,7 @@ a_n x^n + a_{n-1}x^{n-1} + \cdots a_1 x + a_0, \quad a_n \neq 0
|
||||
```julia; hold=true; echo=false; cache=true
|
||||
##{{{ different_poly_graph }}}
|
||||
|
||||
fig_size = (400, 300)
|
||||
|
||||
anim = @animate for m in 2:2:10
|
||||
fn = x -> x^m
|
||||
plot(fn, -1, 1, size = fig_size, legend=false, title="graph of x^{$m}", xlims=(-1,1), ylims=(-.1,1))
|
||||
@@ -109,11 +113,9 @@ of $m$ can be found from two points through the well-known formula:
|
||||
m = \frac{y_1 - y_0}{x_1 - x_0} = \frac{\text{rise}}{\text{run}}
|
||||
```
|
||||
|
||||
```julia; hold=true, echo=false; cache=true
|
||||
```julia; hold=true; echo=false; cache=true
|
||||
### {{{ lines_m_graph }}}
|
||||
|
||||
fig_size = (400, 300)
|
||||
|
||||
anim = @animate for m in [-5, -2, -1, 1, 2, 5, 10, 20]
|
||||
fn = x -> m * x
|
||||
plot(fn, -1, 1, size = fig_size, legend=false, title="m = $m", xlims=(-1,1), ylims=(-20, 20))
|
||||
@@ -177,21 +179,13 @@ Python session. That is great for `Julia` users, as the `PyCall` and
|
||||
manner. This allows the `Julia` package `SymPy` to provide
|
||||
functionality from SymPy within `Julia`.
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
!!! note
|
||||
When `SymPy` is installed through the package manger, the underlying `Python`
|
||||
libraries will also be installed.
|
||||
|
||||
When `SymPy` is installed through the package manger, the underlying `Python`
|
||||
libraries will also be installed.
|
||||
|
||||
""")
|
||||
```
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
The [`Symbolics`](../alternatives/symbolics) package is a rapidly
|
||||
developing `Julia`-only packge that provides symbolic math options.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
The [`Symbolics`](../alternatives/symbolics) package is a rapidly
|
||||
developing `Julia`-only packge that provides symbolic math options.
|
||||
|
||||
----
|
||||
|
||||
@@ -212,10 +206,8 @@ that can be made. The `@syms` macro documentation lists them. The
|
||||
symbols. The *macro* `@syms` does not need assignment, as the
|
||||
variable(s) are created behind the scenes by the macro.
|
||||
|
||||
```julia;echo=false
|
||||
note("""Macros in `Julia` are just transformations of the syntax into other syntax. The `@` indicates they behave differently than regular function calls.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
Macros in `Julia` are just transformations of the syntax into other syntax. The `@` indicates they behave differently than regular function calls.
|
||||
|
||||
|
||||
The `SymPy` package does three basic things:
|
||||
@@ -440,8 +432,6 @@ larger values of $n$ have greater growth once outside of $[-1,1]$:
|
||||
```julia; hold=true; echo=false; cache=true
|
||||
### {{{ poly_growth_graph }}}
|
||||
|
||||
fig_size = (400, 300)
|
||||
|
||||
anim = @animate for m in 0:2:12
|
||||
fn = x -> x^m
|
||||
plot(fn, -1.2, 1.2, size = fig_size, legend=false, xlims=(-1.2, 1.2), ylims=(0, 1.2^12), title="x^{$m} over [-1.2, 1.2]")
|
||||
@@ -482,8 +472,6 @@ of the plot window until the graph appears U-shaped.
|
||||
```julia;hold=true; echo=false; cache=true
|
||||
### {{{ leading_term_graph }}}
|
||||
|
||||
fig_size = (400, 300)
|
||||
|
||||
anim = @animate for n in 1:6
|
||||
m = [1, .5, -1, -5, -20, -25]
|
||||
M = [2, 4, 5, 10, 25, 30]
|
||||
@@ -728,8 +716,8 @@ What is the leading term of $p$?
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = ["``3``", "``3x^2``", "``-2x``", "``5``"]
|
||||
ans = 2
|
||||
radioq(choices, ans)
|
||||
answ = 2
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -761,8 +749,8 @@ The linear polynomial $p = 2x + 3$ is written in which form:
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = ["point-slope form", "slope-intercept form", "general form"]
|
||||
ans = 2
|
||||
radioq(choices, ans)
|
||||
answ = 2
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -781,8 +769,8 @@ What command will return the value of the polynomial when $x=2$?
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [q"p*2", q"p[2]", q"p_2", q"p(x=>2)"]
|
||||
ans = 4
|
||||
radioq(choices, ans)
|
||||
answ = 4
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -796,8 +784,8 @@ L"Be $U$-shaped, opening upward",
|
||||
L"Be $U$-shaped, opening downward",
|
||||
L"Overall, go upwards from $-\infty$ to $+\infty$",
|
||||
L"Overall, go downwards from $+\infty$ to $-\infty$"]
|
||||
ans = 3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -810,8 +798,8 @@ L"Be $U$-shaped, opening upward",
|
||||
L"Be $U$-shaped, opening downward",
|
||||
L"Overall, go upwards from $-\infty$ to $+\infty$",
|
||||
L"Overall, go downwards from $+\infty$ to $-\infty$"]
|
||||
ans = 1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -824,8 +812,8 @@ L"Be $U$-shaped, opening upward",
|
||||
L"Be $U$-shaped, opening downward",
|
||||
L"Overall, go upwards from $-\infty$ to $+\infty$",
|
||||
L"Overall, go downwards from $+\infty$ to $-\infty$"]
|
||||
ans = 2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ = 2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -860,7 +848,7 @@ choices = [q"x^3 - 3x^2 + 2x",
|
||||
q"x^3 - x^2 - 2x",
|
||||
q"x^3 + x^2 - 2x",
|
||||
q"x^3 + x^2 + 2x"]
|
||||
ans = 2
|
||||
answ = 2
|
||||
radioq(choices, 2)
|
||||
```
|
||||
|
||||
@@ -874,6 +862,6 @@ q"-h^2 + 3hx - 3x^2",
|
||||
q"h^3 + 3h^2x + 3hx^2 + x^3 -x^3/h",
|
||||
q"x^3 - x^3/h",
|
||||
q"0"]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user