Skip to content
DeepForgeby svx
All problems
EasyCalculusca-325

Scalar Chain Rule Product

Problem

For the composition h(x) = g(f(x)), the derivative at a point is g'(f(x)) * f'(x).

Given the numeric values dfdx and dgdu, return the chain rule product.

Hint

Multiply the outer derivative by the inner derivative.

Test cases

case 1
in: [2,3]
expected: 6
case 2
in: [-1,4]
expected: -4
case 3
in: [0,5]
expected: 0
Starter codePython
def scalar_chain_rule_product(dfdx, dgdu):
    # Your code here
    pass

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