Let's make a function to determine phases or the start and end of our graph's cycles. We'll write a function that finds the `x`

intercepts of both the polynomial and sine graphs. Recall that these two functions appear as follows:

(defn polynomial [a b c x] (-> (+ (* a (Math/pow x 3)) (* b (Math/pow x 2))) (- (* c x)))) (defn sine [a b d x] (- (* a (Math/sin (* b (- x (/ Math/PI 2))))) d))

Looking again at the representative graphs, the first thing to note is a constant *x* intercept of *x=0*. Next, if we go in either direction, the graph goes in a particular direction, then returns to pass through *x*, and winds back up again:

Start Free Trial

No credit card required