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.Wed, 13 Apr 2016 00:20:01 +0200Define a function with different caseshttps://ask.sagemath.org/question/33085/define-a-function-with-different-cases/I'm working with a function whose functional form is different at a specific value of the parameter (a=1):
if a==1:
U(x,L)=log(x)+log(1-L)
else:
U(x,L)=(x^(1-a)/(1-a)+(1-L)^(1-a)/(1-a))
Is it possible to define once and for all a function U(x,L,a) which includes the parameter as a variable so that I don't need to redefine it when a = 1?
Massimo2013Wed, 13 Apr 2016 00:20:01 +0200https://ask.sagemath.org/question/33085/case distinction in symbolic expressionhttps://ask.sagemath.org/question/9907/case-distinction-in-symbolic-expression/Is it possible to include a case distinction in a symbolic expression?
More precisely, I'm currently trying to understand how to include a [truncated power function](http://en.wikipedia.org/wiki/Truncated_power_function) into a symbolic expression, if that is at all possible.MvGWed, 13 Mar 2013 12:25:38 +0100https://ask.sagemath.org/question/9907/