Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Limits pre- & post-Solve[]

  • To: mathgroup at
  • Subject: [mg14623] Re: Limits pre- & post-Solve[]
  • From: mark at (Mark Stevens)
  • Date: Wed, 4 Nov 1998 13:46:53 -0500
  • Organization: Salford Software Ltd
  • References: <70rkib$4u5$>
  • Sender: owner-wri-mathgroup at

The simplest answer to this question is to set n=m using 'Block'. This
performs the substitution before 'Solve' gets to process the equations
and 'Solve' gets the correct answer right off:

Block[{n=m},Solve[Integrate[m x + b,{x,0,t+h}]==
                      Integrate[n x +c,{x,0,t-h}],h]]
In a way this is just doing what you did manually to produce Out[158],
but obviously it could form part of some larger construct which sets n
to a range of values - so it may be an effective answer to your
As far as I can see the real problem lies with 'Limit' rather than
'Solve', which produced a valid answer either way of working. I think
the trouble is that 'Limit' gets confused because of the two-valued
nature of the square root - if you take the negative branch of the Sqrt
the answer is indeed infinite. Maybe Mathematica should make 'Limit'
put out a diagnostic on these occasions, or even have an option to use
the same assumptions as PowerExpand.

David Bailey
Salford Software Ltd.

On 24 Oct 1998 04:20:27 GMT, "Richard W. Klopp" <rwklopp at>

>I've run into difficulties while solving a practical problem. I can
>illustrate with a simpler example. Consider two linear functions
>f[x]:=m x + b, and g[x]:= n x + c. The question that I want to answer
>is how far from the origin do I have to integrate each function so that
>their definite integrals are equal. I ask for the answer as left and
>right offset h from some target ordinate t, as shown below. Visualize
>it as equating the areas under two straight lines bounded on the left
>by the origin.
>Solve[Integrate[m x + b,{x,0,t+h}]==Integrate[n x + c,{x,0,t-h}],h]
>{{h -> (-b - c - m*t - n*t - 
>       Sqrt[b^2 + 2*c*b + 4*n*t*b + c^2 + 4*m*n*t^2 + 4*c*m*t])/
>     (m - n)}, {h -> 
>    (-b - c - m*t - n*t + Sqrt[b^2 + 2*c*b + 4*n*t*b + c^2 + 
>         4*m*n*t^2 + 4*c*m*t])/(m - n)}}
>I think that you can anticipate the problem if the slopes of the lines,
>m and n are the same:
>Solve[Integrate[m x + b,{x,0,t+h}]==Integrate[n x +
>\!\(Power::"infy" \( : \ \) "Infinite expression \!\(1\/0\)
>\!\(Power::"infy" \( : \ \) "Infinite expression \!\(1\/0\)
>{{h -> ComplexInfinity}, {h -> ComplexInfinity}}
>Taking the limit as one slope approaches the other m->n doesn't help.
>Limit[h/.Solve[Integrate[m x + b,{x,0,t+h}]==Integrate[n x +
>  n->m]
>{DirectedInfinity[b + c + 2*m*t + 
>    Sqrt[b^2 + 2*c*b + 4*m*t*b + c^2 + 4*m^2*t^2 + 4*c*m*t]], 
>  DirectedInfinity[b + c + 2*m*t - 
>    Sqrt[b^2 + 2*c*b + 4*m*t*b + c^2 + 4*m^2*t^2 + 4*c*m*t]]}
>However, if I makes the slopes equal before I Solve[], everything's
>h/.Solve[((Integrate[m x + b,{x,0,t+h}]-Integrate[n x +
>      0,h]
>{((-b + c)*t)/(b + c + 2*m*t)}
>What's going on and how do I get In[154] to behave as I desire, that is,
>come out with something like Out[158]?

David Bailey                        Salford Software Ltd Adelphi House, 
Adelphi Street,  Salford,  M3  6EN,   UK Tel: +44 (0) 161 834 2454     
Fax: +44 161 834 2148 Web:  email:
db at

  • Prev by Date: Comparison of Mathematica on Various Computers
  • Next by Date: Junior Research Fellow/Research Assistant in CFD
  • Previous by thread: Comparison of Mathematica on Various Computers
  • Next by thread: Re: Limits pre- & post-Solve[]