Quartic Function with a W-Shaped Graph

Interactive Quartic Function with a W-Shaped Graph graph — click to explore
Click the graph to explore it interactively →
Question: create a continuous W that goes across the x axis
To create a continuous "W"-shaped curve that extends across the x-axis, we can use a quartic (degree 4) polynomial function.

Mathematical Formulation

A general symmetric quartic function of the form:
f(x) = a x^4 - b x^2 + c \quad (a > 0, b > 0)
produces the characteristic "W" shape:
  1. End Behavior: As x \to \pm\infty, the dominant term a x^4 \to +\infty, causing both outer branches to rise upwards.
  2. Turning Points (Critical Points): Taking the first derivative: f'(x) = 4a x^3 - 2b x = 2x(2a x^2 - b) = 0This yields three stationary points:
    • A local maximum (central peak) at x = 0 with y = c.
    • Two local minima (bottom valleys) at x = \pm\sqrt{\frac{b}{2a}} with y = c - \frac{b^2}{4a}.
  3. Crossing the x-axis: By choosing c > 0 and c - \frac{b^2}{4a} < 0, the central peak sits above the x-axis while both valleys dip below the x-axis. This ensures the curve crosses the x-axis at four distinct real roots.

Specific Example

Using f(x) = \frac{1}{2}x^4 - 3x^2 + 2:
  • Central Peak: (0, 2)
  • Valleys: (-\sqrt{3}, -2.5) and (\sqrt{3}, -2.5)
  • x-intercepts: Four symmetric roots where f(x) = 0: x = \pm\sqrt{3 \pm \sqrt{5}} \approx \pm 2.29, \pm 0.87
The interactive diagram illustrates this continuous "W" curve with its critical points and roots clearly marked. You can also use the slider k to shift the curve vertically and observe how the intersections with the x-axis change.