Loading...
Loading...
You are given a list of strings funcInputs, a list of strings funcOutputs, both of length n, and two strings a and b. The ith function computes the quantity funcOutputs[i] from the quantities named in funcInputs[i]. Each element of funcInputs is a list of items separated by commas. Each item is a quantity name, a space, and an integer d, the partial derivative of the ith function with respect to that quantity at a fixed point.
A quantity that is not the output of any function is free, and every free quantity has a fixed value. Return the derivative of b with respect to a. Note that the answer, and all intermediate derivatives, will have absolute value less than 10^15.
funcInputs.length = funcOutputs.length =nfuncInputs[i] ≤10funcInputs[i] has at most 100 characters.funcInputs.d of each itema is not the output of any function.b depends on a.The inputs describe the functions y1=f(x1,x2) and y2=g(y1,x1). The answer is given by dg(y1,x1)/dx1 + dg(y1,x1)/dy1*df(x1,x2)/dx1. Thus the result is -1 + 2*2=3.
The rate of change of y with respect to x is 2.
y1 changes by 1 per unit of x1, y2 picks up 2 times that change, and y2 also responds to x1 directly at rate 5, so the answer is 7.
y1 and y2 change with x at rates 2 and 3, and z adds both rates, so the answer is 5.