ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 24 Dec 2016 20:44:49 +0100Why use symbolic functions?https://ask.sagemath.org/question/36084/why-use-symbolic-functions/ So, I can do the following by introducing x as a symbolic function.
sage: var('b,c,t')
(b, c, t)
sage: x(t) = sqrt(b^2 + c^2*t^2) - b
sage: x
t |--> -b + sqrt(c^2*t^2 + b^2)
sage: diff(x,t)
t |--> c^2*t/sqrt(c^2*t^2 + b^2)
I can introduce x as a variable with assigned symbolic values, and get the same result.
sage: var('b,c,t')
(b, c, t)
sage: x = sqrt(b^2 + c^2*t^2) - b
sage: x
-b + sqrt(c^2*t^2 + b^2)
sage: diff(x,t)
c^2*t/sqrt(c^2*t^2 + b^2)
So, since I can do the same thing using variables, why use symbolic functions at all? Can symbolic functions do things that variables can't do?
Thanks in advance.omoplataSat, 24 Dec 2016 20:44:49 +0100https://ask.sagemath.org/question/36084/functions of variables with matriceshttps://ask.sagemath.org/question/35101/functions-of-variables-with-matrices/I am trying to make a function of a variable with sage for example:
f(x) = sin(x)
f(x+y)
yields:
sin(x+y)
However if It is in a matrix this no longer works:
f(x) = matrix([[sin(x)],[cos(x)]])
f(x+y)
yields:
sin(x)
cos(x)
Is this not possible or am I missing something to make this work?
I am using sage 7.3 on Ubuntu 16.04 with the aims ppa.rtcMon, 10 Oct 2016 03:19:04 +0200https://ask.sagemath.org/question/35101/I don't know why Sage return 0 for integrate(sin(2*x).abs(),(x,0,pi)) when its value is 2https://ask.sagemath.org/question/25269/i-dont-know-why-sage-return-0-for-integratesin2xabsx0pi-when-its-value-is-2/When I try integrate(sin(x).abs(),(x,0,pi)) the program return the same thing. The numerical integration is correct, the program return (1.9999999999999998, 2.220446049250313e-14). I don't know if it is a bug or what. Any help? I have tried sage 6.2, 6.3, 6.4.1
Mathematica can do It without any problem http://www.wolframalpha.com/input/?i=Integrate[Abs[Sin[2*x]]%2C{x%2C0%2CPi}]
Neither Sympy nor Maxima can't compute this.ArturoSun, 14 Dec 2014 16:25:05 +0100https://ask.sagemath.org/question/25269/Is there a way to set arbitrary function commuting rules?https://ask.sagemath.org/question/8486/is-there-a-way-to-set-arbitrary-function-commuting-rules/I am trying to perform a derivation using discrete difference operations, but I don't want to actually define my discrete operator. What I would like to do, is specify
d = function('d')
var('x y')
I'd like to specify d(x*y) = d(x*y) (multiplication does not commute), but I need d(x+y) = d(x) + d(y) (addition does commute). Any ideas?
tcfisherThu, 17 Nov 2011 15:13:21 +0100https://ask.sagemath.org/question/8486/