Ask Your Question
0

Derivative of a recurrence equation

asked 2019-05-16 10:16:22 +0100

updated 2019-05-19 23:21:16 +0100

slelievre gravatar image

Given:

var('β α γ t R')
c = function('c')
g = function('g')
f = function('f')
λ = function('λ')

suppose I define a function as

def U(l):
    eq = 0
    for i in range(l):
        eq += (β^i)*(((c(t+i)+α*g(t+i))^(1-R))/(1-R))
    return eq

How do I take the first order derivative w.r.t. C_t C_t+1 and so forth?

I tried:

n = 2
L = U(n)
L.derivative(c(t))

without any luck.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-05-17 00:07:07 +0100

nbruin gravatar image

Does something like

L.subs(c(t)==x).diff(x).subs(x==c(t))

do the trick for you?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-05-16 10:16:22 +0100

Seen: 257 times

Last updated: May 19 '19