Ask Your Question

alpha0's profile - activity

2019-07-21 16:40:42 +0200 received badge  Nice Question (source)
2019-07-16 20:43:48 +0200 received badge  Student (source)
2019-07-16 15:58:45 +0200 asked a question Plotting derivative of bump function

I wish to plot the derivative of the piecewise function equal to $\exp((1 - x^2)^{-1})$ on (-1, 1) and 0 everywhere else (just as an example). I attempted this by defining to define in sage

f(x) = piecewise([(-oo, -1), 0], [(-1, 1), exp(-1/(1 - x^2)), [(1, oo), 0]]

and then let g = diff(f(x), x)). When i try to evaluate g at various values (for example 0.3), I get 0.333237077156224*(0, 0, 0) + 0.333237077156224, and the number that appears is not only incorrect (in that it is not the derivative it ought to equal), but the expression that appears can't be turned into a single number. My ultimate objective is to obtain plots of various linear combinations of such expressions, so what would be the best way to go about doing this? In addition, what exactly is going on here?

2019-07-16 15:58:45 +0200 asked a question Derivative of piecewise function

I wish to plot the derivative of the piecewise function equal to $\exp((1 - x^2)^{-1})$ on (-1, 1) and 0 everywhere else (just as an example). I attempted this by defining to define in sage

f(x) = piecewise([(-oo, -1), 0], [(-1, 1), exp(-1/(1 - x^2)), [(1, oo), 0]]

and then let g = diff(f(x), x)). When i try to evaluate g at various values (for example 0.3), I get 0.333237077156224*(0, 0, 0) + 0.333237077156224, and the number that appears is not only incorrect (in that it is not the derivative it ought to equal), but the expression that appears can't be turned into a single number. My ultimate objective is to obtain plots of various linear combinations of such expressions, so what would be the best way to go about doing this?