part of equation as function



I've not really been following this much but you can make ":="
evaluate parts of the right-hand-side by putting it inside parentheses
and prefixing with two single quotes ('')

(%i1) f(x) := expand( x*(x+1) );
(%o1) f(x) := expand(x (x + 1))

(%i2) g(x) := ''( expand( x*(x+1) ) )
(%o2) g(x) := x^2 + x



On Wed, Mar 14, 2012 at 1:22 AM, Jaime Villate <villate at fe.up.pt> wrote:
> On 03/14/2012 06:15 AM, Robert Dodier wrote:
>>
>> On 3/13/12, Jaime Villate<villate at fe.up.pt> ?wrote:
>>
>>> for mathematical functions use always define() instead of :=. Think of
>>> := as a way to define a small program, rather than defining a function.
>>
>> I dunno. The difference between ":=" and define is that the latter
>> evaluates its arguments and the former doesn't. That's the extent
>> of it. There isn't any sense in which one is more mathematical
>> than the other.
>>
> I didn't say that define is more mathematical than := you just read it that
> way.
>
> I just advised the user to use define for what he is doing, in anticipation
> of his
> next question: "why df(x) := diff(f(x), x) doesn't work?
>
> Cheers,
> Jaime
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima