evalf integration with multiple free constants

117 Views Asked by At

How to get numeric value of integration:

eq:=int(c*x^(4/5)*exp((1+x)^(1/7)),x=1..2)

I tried to do:

assume(c,real);
evalf(eq,5);

The output I am expecting is:

4.32052c

But it doesn't work (with output same as input).

Thanks in advance,

1

There are 1 best solutions below

1
On BEST ANSWER

Pull the symbolic coefficient outside the integral, so that the definite integral is then purely numeric and may evaluate to a float under evalf.

restart;

eq := int(c*x^(4/5)*exp((1+x)^(1/7)),x=1..2);

             /   (4/5)    /       (1/7)\            \
          int\c x      exp\(1 + x)     /, x = 1 .. 2/

expand(eq);

           /   / (4/5)    /       (1/7)\            \\
         c \int\x      exp\(1 + x)     /, x = 1 .. 2//

evalf(%);

                     4.320521355 c