Ask Your Question

J. Serra's profile - activity

2024-05-05 10:16:46 +0100 received badge  Famous Question (source)
2024-03-20 19:14:35 +0100 received badge  Notable Question (source)
2024-03-20 19:14:35 +0100 received badge  Popular Question (source)
2021-01-18 16:55:39 +0100 commented answer Integration of multivariable piecewise function in SageMath

Thanks @Juanjo, this is a good alternative definition and solves my problem. Would be good to understand what is wrong with piecewise

2021-01-17 22:05:57 +0100 received badge  Supporter (source)
2021-01-16 21:54:12 +0100 received badge  Student (source)
2021-01-16 17:07:11 +0100 asked a question Integration of multivariable piecewise function in SageMath

I have a problem that can be simplified as below:

g(w) = piecewise([[[0, 3], (w-3)^2], [(3, infinity), 0]])  
f(w,t) = g*cos(w*t)  # t >= 0
#assume(t, 'real')  
h = integral(f, w, 0, 10); h

Out: t |--> undef

If I do not use piecewise, and integrate only up to w = 3 (where I know g becomes zero), then I obtain the wanted solution:

g2(w) = (w-3)^2
f2(w, t) = g2*cos(w*t)
h2 = integral(f2, w, 0, 3); h2

Out: t |--> 6/t^2 - 2sin(3t)/t^3

How can I integrate f(w, t) defining g(w) piece-wisely (or equivalent)?