Re: Graphing, Symbolic Manipulation, and Regressions
- To: mathgroup at smc.vnet.net
- Subject: [mg25565] Re: Graphing, Symbolic Manipulation, and Regressions
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sat, 7 Oct 2000 03:36:13 -0400 (EDT)
- References: <8rjkj0$ojc@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ian,
Plot[{(x(x + 2))/x^2, x^2(x - 2)/x},
{x, -3, 3},
PlotLabel -> HoldForm[{StyleForm[(x(x + 2))/x^2, FontColor -> Hue[0]],
StyleForm[x^2(x - 2)/x, FontColor -> Hue[.7]]}],
PlotStyle -> {{Hue[0]}, {Hue[.7]}}
];
HoldForm prevents the cancelling.
For quadratic formula that you want, InterpolatingPolynomial seems to be the
thing, not Fit.
InterpolatingPolynomial[{{1, 3}, {-1, -3}, {2, 6}}, x]
3 + 3 (-1 + x)
Check
% /. {{x -> 1}, {x -> -1}, {x -> 2}}
{3, -3, 6}
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"Ian Fan" <ian at v-wave.com> wrote in message news:8rjkj0$ojc at smc.vnet.net...
> Hello, can anyone please help me by telling me how to graph more than one
> function on the same graph; and also how I would go about graphing "non
> functions", ex. graphing y= +/-Sqrt[x].
>
> Also, is there any way to be able to just *show* the function that I
input?
> ex. (x(x + 2))/x^2 that would come out as:
>
> x(x + 2)
> ---------
> x^2
>
> instead of the simplified form:
>
> 2 + x
> -------
> x
>
> Lastly, how would I go about doing regressions? I tried reading the help
> files but it did not help me much. For example, if I want to find the
> formula for the quadratic equation with the points (1, 3), (-1, -3), (2,
6)
> what command would I put in?
>
> Any help would be greatly appreciated, thanks in advance.
>
>
>
>