The Bernoulli polynomial B_n(x) is a polynomial of order n with the properties that B_0(x) = 1 and for n > 0
B'_n(x) = n B_{n-1}(x),
where the prime denotes differentiation with respect to x, and
Integral[B_n(x),{x,0,1}] = 0.
Therefore, B_1(x) = x-1/2, B_2(x) = x^2 – x + 1/6, B_3(x) = x^3 – 3 x^2/2 + x/2, etc. Notice that B_n(0) is the nth Bernoulli number.
Write a function to generate the Bernoulli polynomial of order n. Use MATLAB's approach for specifying the coefficients. For example, the function should return [1 -1/2] for n = 1 and [1 -1 1/6] for n = 2.

Solution Stats

16 Solutions

9 Solvers

Last Solution submitted on Jan 26, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...