Skip to content
DeepForgeby svx
All problems
EasyCalculusca-293

Power Rule Antiderivative Coefficients

Problem

Integrate a polynomial term by term with zero constant: if f(x) = sum_i coeffs[i] * x^i then F(x) = sum_i coeffs[i] * x^(i+1) / (i+1).

Return the antiderivative coefficients in ascending order with a leading 0.0 constant term.

Hint

Divide each coefficient by its new exponent and prepend the integration constant.

Test cases

case 1
in: [[1,2,3]]
expected: [0,1,1,1]
case 2
in: [[4]]
expected: [0,4]
case 3
in: [[0,1]]
expected: [0,0,0.5]
Starter codePython
def power_rule_antiderivative_coeffs(coeffs):
    # Your code here
    pass

3 test cases · run your code against them in the editor