Problem 61148. Shifting vertically even-degree polynomial's graph by its mean over an interval

Let p be an even-degree polynomial with positive leading coefficient. Consider its vertical translation by shifting its graph by its average value over a specified interval [a, b], with a<b.
The interval [a, b] is defined such that the endpoints a and b stand for the least and the greatest x-values of the equation p(x) = y_peak, the lowest and the largest real solutions, respectively. Here, y_peak stands for the highest local maximum of the polynomial p (see non-scale figures below).
Given p, return
  • the endpoints a and b if they exist. Otherwise, return a = '' and b = '' (see Hint 1);
  • the shifting constant, k, which stands for the above vertical translation (see Hint 2). Return k = '' if the interval is empty.
Hint 1. An n-degree polynomial has exactly n roots (counting multiplicity) in the complex number system. An odd-degree polynomial always has at least one real root. Therefore, a real polynomial of even degree always has at least one vertex, but might not have local maxima.
Hint 2. To calculate the mean of a continuous function, use the integral definition.
input: p
output: [a, b, k]
Vertical shift

Solution Stats

No one has attempted to solve this problem yet. Be the first!

Solution Comments

Show comments

Problem Recent Solvers0

No solvers yet, be the first player to solve this problem.

Suggested Problems

More from this Author14

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!