{ "hash": "13e885e4664899be10154cf735873472", "result": { "markdown": "# Polynomials\n\n\n\nIn this section we use the following add-on packages:\n\n``` {.julia .cell-code}\nusing SymPy\nusing Plots\n```\n\n\n\n\n---\n\n\nPolynomials are a particular class of expressions that are simple enough to have many properties that can be analyzed. In particular, the key concepts of calculus: limits, continuity, derivatives, and integrals are all relatively trivial for polynomial functions. However, polynomials are flexible enough that they can be used to approximate a wide variety of functions. Indeed, though we don't pursue this, we mention that `Julia`'s `ApproxFun` package exploits this to great advantage.\n\n\nHere we discuss some vocabulary and basic facts related to polynomials and show how the add-on `SymPy` package can be used to model polynomial expressions within `SymPy`. `SymPy` provides a Computer Algebra System (CAS) for `Julia`. In this case, by leveraging a mature `Python` package [SymPy](https://www.sympy.org/). Later we will discuss the `Polynomials` package for polynomials.\n\n\nFor our purposes, a *monomial* is simply a non-negative integer power of $x$ (or some other indeterminate symbol) possibly multiplied by a scalar constant. For example, $5x^4$ is a monomial, as are constants, such as $-2=-2x^0$ and the symbol itself, as $x = x^1$. In general, one may consider restrictions on where the constants can come from, and consider more than one symbol, but we won't pursue this here, restricting ourselves to the case of a single variable and real coefficients.\n\n\nA *polynomial* is a sum of monomials. After combining terms with same powers, a non-zero polynomial may be written uniquely as:\n\n\n\n$$\na_n x^n + a_{n-1}x^{n-1} + \\cdots a_1 x + a_0, \\quad a_n \\neq 0\n$$\n\n::: {.cell cache='true' hold='true' execution_count=4}\n\n::: {.cell-output .cell-output-display execution_count=5}\n```{=html}\n
Polynomials of varying even degrees over \\([-1,1]\\).
\nGraphs of y = mx for different values of m
\nDemonstration that \\(x^{10}\\) grows faster than \\(x^8\\), ... and \\(x^2\\) grows faster than \\(x^0\\) (which is constant).
\nThe previous graph is highlighted in red. Ultimately the leading term (\\(x^4\\) here) dominates the graph.
\n