Skip to content
DeepForgeby svx
All problems
EasyCalculusca-014

Linearization Approximation

Problem

Evaluate the linearization (tangent line approximation) of f(x) = sum(coeffs[i] * x^i) centered at a, at the point x:

L(x) = f(a) + f'(a) * (x - a)

Hint

This is just the tangent line evaluated at x instead of returned as coefficients.

Test cases

case 1
in: [[0,0,1],4,4.1]
expected: 16.8
case 2
in: [[1,0,0,1],2,2.5]
expected: 15
case 3
in: [[0,0,0,1],0,0.1]
expected: 0
case 4
in: [[2,3],0,5]
expected: 17
Starter codePython
def linearization(coeffs, a, x):
    # Your code here
    pass

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