# Nakafa Framework: LLM

URL: /en/subject/high-school/11/mathematics/polynomial/polynomial-graph
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/high-school/11/mathematics/polynomial/polynomial-graph/en.mdx

Output docs content for large language models.

---

import { LineEquation } from "@repo/design-system/components/contents/line-equation";
import { getColor } from "@repo/design-system/lib/color";

export const metadata = {
  title: "Polynomial Graph",
  description: "Master polynomial graphing with point plotting, end behavior analysis, and visual patterns. Learn to sketch linear, quadratic, and cubic graphs step-by-step.",
  authors: [{ name: "Nabil Akbarazzima Fatih" }],
  date: "05/04/2025",
  subject: "Polynomial",
};

## Graphing Polynomial Functions

The graph of a polynomial function provides a visual representation of how the function's value changes as the input value <InlineMath math="x" /> changes. The shape of this graph can vary greatly depending on the degree and coefficients of the function.

## Point Plotting Method

The most fundamental way to draw a graph is by determining several <InlineMath math="(x, y)" /> point pairs that satisfy the function, then connecting them with a smooth curve.

**Steps:**

1.  Choose several different values for <InlineMath math="x" />.
2.  Calculate the value <InlineMath math="y = P(x)" /> for each chosen <InlineMath math="x" /> value.
3.  Create a table of <InlineMath math="(x, y)" /> value pairs.
4.  Plot these points on the coordinate plane.
5.  Connect the points with a smooth and continuous curve.

### Linear Function (Degree 1)

Graph the function <InlineMath math="f(x) = 2x + 5" />.

We choose several <InlineMath math="x" /> values and calculate <InlineMath math="y" />:

| <InlineMath math="x" /> | <InlineMath math="y = f(x)" /> | <InlineMath math="(x, y)" />   |
| :---------------------- | :----------------------------- | :----------------------------- |
| -3                      | -1                             | <InlineMath math="(-3, -1)" /> |
| -2                      | 1                              | <InlineMath math="(-2, 1)" />  |
| -1                      | 3                              | <InlineMath math="(-1, 3)" />  |
| 0                       | 5                              | <InlineMath math="(0, 5)" />   |
| 1                       | 7                              | <InlineMath math="(1, 7)" />   |
| 2                       | 9                              | <InlineMath math="(2, 9)" />   |
| 3                       | 11                             | <InlineMath math="(3, 11)" />  |

Plot the points and connect them:

<LineEquation
  title={
    <>
      Graph of <InlineMath math="f(x) = 2x + 5" />
    </>
  }
  description="Graph of a linear function (degree 1)."
  showZAxis={false}
  cameraPosition={[0, 0, 15]}
  data={[
    {
      points: Array.from({ length: 7 }, (_, i) => {
        const x = -3 + i;
        return { x, y: 2 * x + 5, z: 0 };
      }),
      color: getColor("YELLOW"),
    },
  ]}
/>

### Quadratic Function (Degree 2)

Graph the function <InlineMath math="g(x) = x^2 - 2x - 3" />.

Table of values:

| <InlineMath math="x" /> | <InlineMath math="y = g(x)" /> | <InlineMath math="(x, y)" />  |
| :---------------------- | :----------------------------- | :---------------------------- |
| -2                      | 5                              | <InlineMath math="(-2, 5)" /> |
| -1                      | 0                              | <InlineMath math="(-1, 0)" /> |
| 0                       | -3                             | <InlineMath math="(0, -3)" /> |
| 1                       | -4                             | <InlineMath math="(1, -4)" /> |
| 2                       | -3                             | <InlineMath math="(2, -3)" /> |
| 3                       | 0                              | <InlineMath math="(3, 0)" />  |
| 4                       | 5                              | <InlineMath math="(4, 5)" />  |

Plot the points and connect with a smooth curve (parabola):

<LineEquation
  title={
    <>
      Graph of <InlineMath math="g(x) = x^2 - 2x - 3" />
    </>
  }
  description="Graph of a quadratic function (degree 2)."
  showZAxis={false}
  cameraPosition={[0, 0, 10]}
  data={[
    {
      points: Array.from({ length: 7 }, (_, i) => {
        const x = -2 + i;
        return { x, y: x * x - 2 * x - 3, z: 0 };
      }),
      color: getColor("CYAN"),
    },
  ]}
/>

### Cubic Function (Degree 3)

Graph the function <InlineMath math="h(x) = x^3 + 3x^2 - 4" />.

Table of values:

| <InlineMath math="x" /> | <InlineMath math="y = h(x)" /> | <InlineMath math="(x, y)" />    |
| :---------------------- | :----------------------------- | :------------------------------ |
| -4                      | -20                            | <InlineMath math="(-4, -20)" /> |
| -3                      | -4                             | <InlineMath math="(-3, -4)" />  |
| -2                      | 0                              | <InlineMath math="(-2, 0)" />   |
| -1                      | -2                             | <InlineMath math="(-1, -2)" />  |
| 0                       | -4                             | <InlineMath math="(0, -4)" />   |
| 1                       | 0                              | <InlineMath math="(1, 0)" />    |
| 2                       | 16                             | <InlineMath math="(2, 16)" />   |

Plot the points and connect with a smooth curve:

<LineEquation
  title={
    <>
      Graph of <InlineMath math="h(x) = x^3 + 3x^2 - 4" />
    </>
  }
  description="Graph of a cubic function (degree 3)."
  showZAxis={false}
  cameraPosition={[0, 0, 12]}
  data={[
    {
      points: Array.from({ length: 61 }, (_, i) => {
        // Increased points for smoothness
        const x = -4 + i * 0.1;
        return { x, y: x * x * x + 3 * x * x - 4, z: 0 };
      }),
      color: getColor("VIOLET"),
      showPoints: false,
    },
  ]}
/>

## General Characteristics of Polynomial Graphs

Graphs of polynomial functions are always **smooth** (no sharp corners) and **continuous** (no jumps or breaks). Their general shape is heavily influenced by the **degree** of the polynomial.

- **Degree 0:** <InlineMath math="P(x) = c" />. The graph is a horizontal line.
- **Degree 1:** <InlineMath math="P(x) = ax + b" />. The graph is a straight (slanted) line.
- **Degree 2:** <InlineMath math="P(x) = ax^2 + bx + c" />. The graph is a parabola.
- **Degree 3:** <InlineMath math="P(x) = ax^3 + \dots" />. The graph has a shape like the letter 'S' or a reverse 'S', and can have up to two 'peaks' or 'valleys'.
- **Degree 4:** The graph can have up to three 'peaks' or 'valleys'.
- **Degree 5:** The graph can have up to four 'peaks' or 'valleys'.

In general, the graph of a polynomial function of degree <InlineMath math="n" /> can intersect the <InlineMath math="x" />-axis **at most** <InlineMath math="n" /> times and has **at most** <InlineMath math="n-1" /> turning points (peaks or valleys).

## End Behavior

One important characteristic of polynomial graphs is their **end behavior**, which describes the direction of the graph as <InlineMath math="x" /> approaches positive infinity (<InlineMath math="x \to \infty" />) or negative infinity (<InlineMath math="x \to -\infty" />).

The end behavior is determined **solely** by the **leading term** <InlineMath math="a_n x^n" />:

1.  **Degree <InlineMath math="n" /> (Even or Odd)**
2.  **Sign of the Leading Coefficient <InlineMath math="a_n" /> (Positive or Negative)**

There are four possible combinations:

1.  **<InlineMath math="n" /> Even, <InlineMath math="a_n > 0" /> (Positive):**

    - As <InlineMath math="x \to \infty" />, <InlineMath math="y \to \infty" /> (rises right <InlineMath math="\nearrow" />)
    - As <InlineMath math="x \to -\infty" />, <InlineMath math="y \to \infty" /> (rises left <InlineMath math="\nwarrow" />)
    - Examples: <InlineMath math="y = x^2" />, <InlineMath math="y = x^4" />

      <LineEquation
        title={
          <>
            Graph of <InlineMath math="y = x^2" /> (Even, Positive)
          </>
        }
        description="Graph rises to the left and right."
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 7 }, (_, i) => {
              const x = -3 + i;
              return { x, y: x * x, z: 0 };
            }),
            color: getColor("LIME"),
          },
        ]}
      />

2.  **<InlineMath math="n" /> Even, <InlineMath math="a_n < 0" /> (Negative):**

    - As <InlineMath math="x \to \infty" />, <InlineMath math="y \to -\infty" /> (falls right <InlineMath math="\searrow" />)
    - As <InlineMath math="x \to -\infty" />, <InlineMath math="y \to -\infty" /> (falls left <InlineMath math="\swarrow" />)
    - Examples: <InlineMath math="y = -x^2" />, <InlineMath math="y = -x^6" />

      <LineEquation
        title={
          <>
            Graph of <InlineMath math="y = -x^2" /> (Even, Negative)
          </>
        }
        description="Graph falls to the left and right."
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 7 }, (_, i) => {
              const x = -3 + i;
              return { x, y: -(x * x), z: 0 };
            }),
            color: getColor("ROSE"),
          },
        ]}
      />

3.  **<InlineMath math="n" /> Odd, <InlineMath math="a_n > 0" /> (Positive):**

    - As <InlineMath math="x \to \infty" />, <InlineMath math="y \to \infty" /> (rises right <InlineMath math="\nearrow" />)
    - As <InlineMath math="x \to -\infty" />, <InlineMath math="y \to -\infty" /> (falls left <InlineMath math="\swarrow" />)
    - Examples: <InlineMath math="y = x" />, <InlineMath math="y = x^3" />, <InlineMath math="y = x^5" />

      <LineEquation
        title={
          <>
            Graph of <InlineMath math="y = x^3" /> (Odd, Positive)
          </>
        }
        description="Graph falls to the left and rises to the right."
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 41 }, (_, i) => {
              const x = -3 + i * 0.15;
              return { x, y: x * x * x, z: 0 };
            }),
            color: getColor("SKY"),
            showPoints: false,
          },
        ]}
      />

4.  **<InlineMath math="n" /> Odd, <InlineMath math="a_n < 0" /> (Negative):**

    - As <InlineMath math="x \to \infty" />, <InlineMath math="y \to -\infty" /> (falls right <InlineMath math="\searrow" />)
    - As <InlineMath math="x \to -\infty" />, <InlineMath math="y \to \infty" /> (rises left <InlineMath math="\nwarrow" />)
    - Examples: <InlineMath math="y = -x" />, <InlineMath math="y = -x^3" />

      <LineEquation
        title={
          <>
            Graph of <InlineMath math="y = -x^3" /> (Odd, Negative)
          </>
        }
        description="Graph rises to the left and falls to the right."
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 41 }, (_, i) => {
              const x = -3 + i * 0.15;
              return { x, y: -(x * x * x), z: 0 };
            }),
            color: getColor("AMBER"),
            showPoints: false,
          },
        ]}
      />

### Using End Behavior

Knowing the end behavior is very helpful for identifying the graph of a polynomial function without having to plot it in detail.

**Application Example:**

Match the following functions with their likely end behavior:

1.  <InlineMath math="f(x) = x^4 + 2x^3 - 2x - 3" />

    - Leading term: <InlineMath math="x^4" />
    - Degree <InlineMath math="n=4" /> (Even)
    - Leading coefficient <InlineMath math="a_n=1" /> (Positive)
    - End behavior: Rises left (<InlineMath math="\nwarrow" />), Rises right (<InlineMath math="\nearrow" />)

    <div className="mt-4">
      <LineEquation
        title={
          <>
            Graph of <InlineMath math="f(x) = x^4 + 2x^3 - 2x - 3" />
          </>
        }
        description={
          <>
            End Behavior: <InlineMath math="\nwarrow" />{" "}
            <InlineMath math="\nearrow" />
          </>
        }
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 51 }, (_, i) => {
              const x = -2.5 + i * (4.3 / 50);
              const y = x ** 4 + 2 * x ** 3 - 2 * x - 3;
              return { x, y, z: 0 };
            }),
            color: getColor("TEAL"),
            showPoints: false,
          },
        ]}
      />
    </div>

2.  <InlineMath math="g(x) = -x^3 + 2x^2 - x + 1" />

    - Leading term: <InlineMath math="-x^3" />
    - Degree <InlineMath math="n=3" /> (Odd)
    - Leading coefficient <InlineMath math="a_n=-1" /> (Negative)
    - End behavior: Rises left (<InlineMath math="\nwarrow" />), Falls right (<InlineMath math="\searrow" />)

    <div className="mt-4">
      <LineEquation
        title={
          <>
            Graph of <InlineMath math="g(x) = -x^3 + 2x^2 - x + 1" />
          </>
        }
        description={
          <>
            End Behavior: <InlineMath math="\nwarrow" />{" "}
            <InlineMath math="\searrow" />
          </>
        }
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 51 }, (_, i) => {
              const x = -2.5 + i * 0.1;
              const y = -(x ** 3) + 2 * x ** 2 - x + 1;
              return { x, y, z: 0 };
            }),
            color: getColor("ORANGE"),
            showPoints: false,
          },
        ]}
      />
    </div>

3.  <InlineMath math="h(x) = -x^6 - \frac{11}{4}x^5 + x^4 + 5x^3 + 2" />

    - Leading term: <InlineMath math="-x^6" />
    - Degree <InlineMath math="n=6" /> (Even)
    - Leading coefficient <InlineMath math="a_n=-1" /> (Negative)
    - End behavior: Falls left (<InlineMath math="\swarrow" />), Falls right (<InlineMath math="\searrow" />)

    <div className="mt-4">
      <LineEquation
        title={
          <>
            Graph of{" "}
            <InlineMath math="h(x) = -x^6 - \frac{11}{4}x^5 + x^4 + 5x^3 + 2" />
          </>
        }
        description={
          <>
            End Behavior: <InlineMath math="\swarrow" />{" "}
            <InlineMath math="\searrow" />
          </>
        }
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 111 }, (_, i) => {
              const x = -2.5 + i * (4.1 / 110);
              const y = -(x ** 6) - (11 / 4) * x ** 5 + x ** 4 + 5 * x ** 3 + 2;
              return { x, y, z: 0 };
            }),
            color: getColor("FUCHSIA"),
            showPoints: false,
          },
        ]}
      />
    </div>

4.  <InlineMath math="k(x) = 25x^5 - 20x^4 - 26x^3 + 12x^2 + 9x - 1" />

    - Leading term: <InlineMath math="25x^5" />
    - Degree <InlineMath math="n=5" /> (Odd)
    - Leading coefficient <InlineMath math="a_n=25" /> (Positive)
    - End behavior: Falls left (<InlineMath math="\swarrow" />), Rises right (<InlineMath math="\nearrow" />)

    <div className="mt-4">
      <LineEquation
        title={
          <>
            Graph of{" "}
            <InlineMath math="k(x) = 25x^5 - 20x^4 - 26x^3 + 12x^2 + 9x - 1" />
          </>
        }
        description={
          <>
            End Behavior: <InlineMath math="\swarrow" />{" "}
            <InlineMath math="\nearrow" />
          </>
        }
        showZAxis={false}
        cameraPosition={[0, 0, 15]}
        data={[
          {
            points: Array.from({ length: 71 }, (_, i) => {
              const x = -1.2 + i * 0.035;
              const y =
                25 * x ** 5 -
                20 * x ** 4 -
                26 * x ** 3 +
                12 * x ** 2 +
                9 * x -
                1;
              return { x, y, z: 0 };
            }),
            color: getColor("INDIGO"),
            showPoints: false,
          },
        ]}
      />
    </div>

By analyzing the leading term, we can predict the general shape of the graph at its ends.
