Solving an equation with integral



Michele Minelli <micheleminelli1 at gmail.com> writes:
> Hi everyone,
> First of all I am italian so sorry for my English...
> Anyway, my problem is quite simple (I think) but I'm getting mad on it!
> I have to solve a quite simple equation where the unknown value is the
> second bound of the integral.
> I wrote this:
>
> solve(0.1=integrate(1/(2.9*(3.3-u)-(3.3-u)^2/2), u, 2.26, x), x);
>
> and this is the result:
<snip>
> (%o38)
> [log(2*x+5)=(565040900*log(10*x-33)+565040900*log(-1)-1775128338*%i+113906055)/565040900]
>
> I answered positive because I know that the result should be 2.48 but
> in the end it comes out with imaginary values...
> I also tried to set logabs to true and solveradcan to true but nothing
> good happened.
> How can I solve that equation?
> Thank you very much.

Here's a quick attempt. First note that for symbolic calculations like
integration etc., Maxima automatically rationalizes its arguments. Since
the numbers then come out horrible, let's do it by hand:

  (%i1) integrand: 1/(29/10*(33/10-u)-(33/10-u)^2/2);
                                         1
  (%o1)                       -----------------------
                                  33         33     2
                              29 (-- - u)   (-- - u)
                                  10         10
                              ----------- - ---------
                                  10            2

That looks a little ugly: maybe we can simplify it.

  (%i2) factor(%);
                                         40
  (%o2)                       - ---------------------
                                (2 u + 5) (10 u - 33)

Ah, great. Notice that your integrand has first-order poles at u = 3.3
and u = 2.5 so we'd better assume that x is less than them. Integrating:

  (%i3) integrate (%, u, 226/100, x);
  Is  50 x - 113  positive, negative, or zero?

  pos;
             52
  Is  10 x - --  positive, negative, or zero?
             5

  pos;
  Principal Value
                                                         52        238
                                                     log(--)   log(---)
                log(abs(10 x - 33))   log(2 x + 5)       5         25
  (%o3)   - 40 (------------------- - ------------ - ------- + --------)
                        116               116          116       116


Solving something with log(abs(f(x))) inside is going to be a bit nasty,
but the other side of the equation is just a number, so let's apply
exp() to everything:

  (%i4) exp(%) = exp(1/10);
                log(abs(10 x - 33))   log(2 x + 5)   log(52/5)   log(238/25)
          - 40 (------------------- - ------------ - --------- + -----------)
                        116               116           116          116
  (%o4) %e                                                                    = 
                                                                             1/10
                                                                           %e

Hmm, that's not much cleaner, but radcan will probably help:

  (%i5) radcan(%);
                    10/29  10/29   10/29          10/29
                   2      5      13      (2 x + 5)          1/10
  (%o5)            ------------------------------------ = %e
                      10/29   10/29            10/29
                     7      17      (10 x - 33)

This is looking good! Notice that the powers on the two terms with x are
the same. Let's make a solver's life slightly simpler by raising to the
power 29/10. Notice that 10*x - 33 is negative, which radcan (by
design!) ignored. As such, we'll have to make sure that the next
expression has an abs() around it.

  (%i9) %o5 ^ (29/10);
                            130 abs(2 x + 5)      29/100
  (%o9)                    ------------------ = %e
                           119 abs(10 x - 33)

Right, good, that happened automatically. Now you can either use
to_poly_solve() (which will successfully do this, I think), or keep
going by hand. Since you know x lies in the interval [2.26, 2.5), you
actually know the signs of the expressions inside the abs()
functions. Maxima can keep track of this for you though:

  (%i10) assume (x > 226/100);
                                          113
  (%o10)                             [x > ---]
                                          50
  (%i11) assume (x < 25/10);
                                           5
  (%o11)                              [x < -]
                                           2

<snip a mistake>

  (%i13) %o5 ^ (29/10);
                             130 (2 x + 5)      29/100
  (%o13)                    --------------- = %e
                            119 (33 - 10 x)

This looks promising!

  (%i14) solve(%, x);
                                         29/100
                                  3927 %e       - 650
  (%o14)                     [x = -------------------]
                                         29/100
                                  1190 %e       + 260

  (%i15) float(%);
  (%o15)                      [x = 2.485018482603471]


Tada.


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120719/d4eb7508/attachment-0001.pgp>;