## PREP 2014 Question Authoring - Archived

### Multivariable functions

by Adam Graham-Squire -
Number of replies: 1
How do you define a multivariable function?  And how do you take its partial derivatives?  And where else could I find this information?  I have been trying to figure out breakout exercise 2 from Day 2, and I can't seem to be able to figure it out or figure out where I can find code from someone else who has done something similar.

### Re: Multivariable functions

by Gavin LaRose -

Context("Numeric")->variables->add( y => 'Real' );
$f = Compute( "sin(x y)" );$fx = $f->D('x');$fy = $f->D('y'); Context()->texStrings; BEGIN_TEXT If $$f(x,y) = f$$, then$BR
$$f_x(x,y) =$$ \{ $fx->ans_rule() \}$BR
$$f_y(x,y) =$$ \{ $fy->ans_rule() \} END_TEXT Context()->normalStrings; ANS($fx->cmp() );