Re: Plotting discontinuities using Exclusions
- To: mathgroup at smc.vnet.net
- Subject: [mg122762] Re: Plotting discontinuities using Exclusions
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Thu, 10 Nov 2011 06:50:33 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201111091125.GAA11166@smc.vnet.net>
- Reply-to: drmajorbob at yahoo.com
f = (x^2 - 2 x)/(x - 2);
label = ToString@Factor@Numerator@f/ToString@Denominator@f;
Plot[f, {x, 0, 4}, PlotLabel -> label,
Exclusions -> Reduce[Denominator[f] == 0, x]]
Bobby
On Wed, 09 Nov 2011 05:25:48 -0600, John Accardi <johnaccardi at comcast.net>
wrote:
> Goal: Display the definition of a rational function in factored form
> to better see points of discontinuities, like holes and then plot
> the function showing the hole.
>
> Example 1:
>
> The following does the graph correctly, showing a gap at x = 2 but
> requires an undesirable function definition (I want to specify
> the numerator factored).
>
> f = (x^2 - 2 x)/(x - 2)
>
> (-2 x + x^2)/(-2 + x)
>
> Plot[f, {x, 0, 4}, Exclusions -> Reduce[Denominator[f] == 0, x]]
>
>
> Example 2:
>
> More desirable is to show the function with numerator factored so
> students can see the zero of the bottom being the same as the zero
> in the top for the hole. For example, the following shows the function
> definition
> as desired but the graph then does not show the gap for the hole:
>
> f = x (x - 2)/(x - 2)
>
> x
>
> Plot[f, {x, 0, 4}, Exclusions -> Reduce[Denominator[f] == 0, x]]
>
> I suspect that Mathematica does the cancellation (outputting x) and
> therefore
> loses sight of the discontinuity for the plot.
>
> Question:
>
> How can I use the function definition of Example 2 and the plot output
> of Example 1 in one sequence? (I want to prevent the simplification
> Mathematica does when processing the function definition.)
>
> Thanks for any insights.
>
--
DrMajorBob at yahoo.com
- References:
- Plotting discontinuities using Exclusions
- From: John Accardi <johnaccardi@comcast.net>
- Plotting discontinuities using Exclusions