Forum archive 2000-2006

Michael Hamm - +-

Michael Hamm - +-

by Arnold Pizer -
Number of replies: 0
inactiveTopic+- topic started 1/11/2006; 1:15:02 PM
last post 1/11/2006; 4:47:22 PM
userMichael Hamm - +-  blueArrow
1/11/2006; 1:15:02 PM (reads: 316, responses: 2)
I have

...

$b=random(1,11,1)*random(-1,1,2);

...

The equation of the line tangent to the curve ( y = $a x^3 + $b x ) at

...

How do I rig it so that, if $b<0, it doesn't look like +-?

Thanks,

<| Post or View Comments |>


userBob Byerly - Re: +-  blueArrow
1/11/2006; 3:05:19 PM (reads: 390, responses: 0)
You might want to look at the documentation for FEQ in http://math.webwork.rochester.edu/docs/docs/pglanguage/pod/pgbasicmacros.html

Bob

<| Post or View Comments |>


userJohn Jones - Re: +-  blueArrow
1/11/2006; 4:47:22 PM (reads: 399, responses: 0)
If the equation and text are between BEGIN_TEXT/END_TEXT, then this should happen automatically. It also usually makes the problem more readable.

It is also possible that b is 1 or -1. To fix those cases as well, you could use

$a = random(...);
$b=random(1,11,1)*random(-1,1,2);



$rhs = nicestring([$a, 0, $b, 0]);
# or
# $rhs = nicestring([$a, $b], [x^3, x]);



BEGIN_TEXT
The equation of the line tangent to the curve
\( y = $rhs \) at ...
END_TEXT

I think nicestring is also in PGbasicmacros.

John

<| Post or View Comments |>