Ask Your Question
1

integration of matrix-valued function

asked 9 years ago

jan gravatar image

updated 9 years ago

vdelecroix gravatar image

Hi, I want to compute the (in)definite integral of matrix valued function, for example

var('x')
f =matrix([[x,1],[x^2,2]]);

The command

integrate(f,x,0,1)

doesn't work. I expect matrix as a result - integrated by elements

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 9 years ago

vdelecroix gravatar image

This is not supported but you can use

sage: f.apply_map(lambda e: integrate(e,x,0,1))
[1/2   1]
[1/3   2]

The method apply_map simply applies a function entrywise.

Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 1,054 times

Last updated: Nov 26 '15