MathGroup Archive 1998

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

Search the Archive

Re: Limits pre- & post-Solve[]

The simplest answer to this question is to set n=m using 'Block'. This
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 problem.

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.
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 db at

Richard W. Klopp wrote in message <70rkib$4u5$5 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]?

  • Prev by Date: Re: Limits pre- & post-Solve[]
  • Next by Date: Strange behaviour of Solve[] for equation with numerical coeeficients
  • Previous by thread: Re: Limits pre- & post-Solve[]
  • Next by thread: Junior Research Fellow/Research Assistant in CFD