       Re: New user: Abs[] problem

• To: mathgroup at smc.vnet.net
• Subject: [mg50107] Re: [mg50079] New user: Abs[] problem
• From: Murray Eisenberg <murray at math.umass.edu>
• Date: Sun, 15 Aug 2004 03:14:38 -0400 (EDT)
• Organization: Mathematics & Statistics, Univ. of Mass./Amherst
• References: <200408140550.BAA15327@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Yes, sometimes Mathematica cannot find (all) solutions.  But in this
case, BELIEVE!  Mathematica DID solve it: there are no solutions!

You can see this, e.g., by graphing your piecewise-linear function:

Plot[x + 1 + Abs[2x - 4] + Abs[5 - x], {x, -10, 10}];
Plot[x + 1 + Abs[2x - 4] + Abs[5 - x], {x, 0, 5}];

(The second Plot is just to convince you that the minimum really is
strictly positive.)

Or, you can consider the 4 cases:

case1 = x >= 2 && 5 >= x;
case2 = x >= 2 && 5 < x;
case3 = x < 2 && 5 >= x;
case4 = x < 2 && 5 < x;

The first case gives the closed interval from 2 to 5; the second and
third simplify...

Reduce[case2, x]
x>5
Reduce[case3, x]
x<2

... and the fourth case gives the empty set:

Reduce[case4, x]
False

(You could have done that much without Mahematica, of course.)
Now look at your function of x on each of these intervals:

expr = x + 1 + Abs[2x - 4] + Abs[5 - x];

lin1 = Simplify[expr, case1]
2(1+x)
lin2 = Simplify[expr, case2]
4 (-2 + x)
lin3 = Simplify[expr, case3]
-2 (-5 + x)

Now try to solve the resulting linear equation in each case:

Solve[lin1 == 0, x]
{{x->-1}}
Solve[lin2 == 0, x]
{{x->2}}
Solve[lin3 == 0, x]
{{x->5}}

In each case, the line meets the x-axis at a point outside the interval
on which the corresponding line segment over the interval in question is
the domain of the piece.  QED

Edson.Brusque at smc.vnet.net wrote:
> Hello,
>
>      I'm starting Electrical Engineering and using Mathematica for
> helping me in Calculus e Algebra studies.
>
>      I'm trying to solve this equation on Mathematica:
>          x + 1 - |2x - 4| + |5 - x| = 0
>
>      on the Math* notebook I'm typing:
>          Solve[x + 1 - Abs[2x - 4] + Abs[5 - x] == 0,x]
>
>      but only got an empty output: {{}}
>
>      Someone please can help me get Math* to solve this?

--
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

```

• Prev by Date: Re: Re: Smalest enclosing circle
• Next by Date: Re: Re: Smalest enclosing circle
• Previous by thread: Re: New user: Abs[] problem
• Next by thread: Re: Re: New user: Abs[] problem