Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

one hard integral for Maple: int(exp(cos(x))*cos(x-sin(x)),x=0..2*Pi);

84 views
Skip to first unread message

Nasser M. Abbasi

unread,
Dec 6, 2009, 2:22:27 PM12/6/09
to
FYI,

Maple 12

Can do this integral numerically, but not analytically:

> restart;
f:=exp(cos(x))*cos(x-sin(x));
int(f,x=0..2*Pi);
------> returns unevaluated

> restart;
f:=exp(cos(x))*cos(x-sin(x));
evalf(Int(f,x=0..2*Pi));

6.283185307

OK.

I do not have Maple13, but was wondering if it can do it in Maple13?
--Nasser


Axel Vogt

unread,
Dec 6, 2009, 3:23:41 PM12/6/09
to


Plotting and playing suggests f:= x -> exp(cos(x))*cos(x-sin(x)) is
periodic and symmetric like cos, actually both f(Pi+x) - f(Pi-x) and
f(2*Pi+x) - f(x) are zero, so the task is 2*Int(f(x), x= 0 .. Pi)

Smells like a Fourier thing ... playing with exp(cos(x)+I*sin(x)) and
differentiating gives

Int(f(x),x=0..Pi); expand(%);


Pi
/
|
| exp(cos(x)) cos(x) cos(sin(x))
|
/
0

+ exp(cos(x)) sin(x) sin(sin(x)) dx


And exp(cos(x)+I*sin(-x)); evalc(Im(%)); diff(%, x);


-exp(cos(x)) cos(x) cos(sin(x)) + exp(cos(x)) sin(x) sin(sin(x))


Now -exp(cos(x))*sin(sin(x)) is 0 in 0 and in Pi and an antiderivative,
hence the task is

Int(2*exp(cos(x))*cos(x)*cos(sin(x)),x = 0 .. Pi)

which Maple 12 evaluates to be Pi.

Done.

Nasser M. Abbasi

unread,
Dec 6, 2009, 3:47:40 PM12/6/09
to

"Axel Vogt" <&nor...@axelvogt.de> wrote in message
news:7o2i91F...@mid.individual.net...

hi Alex;

But Pi is the WRONG answer. It should be 2 Pi?

--Nasser


Rouben Rostamian

unread,
Dec 6, 2009, 3:50:32 PM12/6/09
to
On 2009-12-06, Nasser M. Abbasi <n...@12000.org> wrote:
> Maple 12
> Can do this integral numerically, but not analytically:
>
>> restart;
> f:=exp(cos(x))*cos(x-sin(x));
> int(f,x=0..2*Pi);

Maple 11, 12, 13 can do it if we expand f first:

int(expand(f), x=0..2*Pi);

The result is 2*Pi.

--
Rouben Rostamian

Axel Vogt

unread,
Dec 6, 2009, 3:50:56 PM12/6/09
to
Nasser M. Abbasi wrote:
> "Axel Vogt" <&nor...@axelvogt.de> wrote in message
> news:7o2i91F...@mid.individual.net...
>> Nasser M. Abbasi wrote:
...

> hi Alex;
>
> But Pi is the WRONG answer. It should be 2 Pi?
>

As said: your original integral is twice of it. Axel

Nasser M. Abbasi

unread,
Dec 6, 2009, 3:54:14 PM12/6/09
to

"Nasser M. Abbasi" <n...@12000.org> wrote in message
news:hfh586$84q$1...@aioe.org...

Alex, With the transformation you did, I was not sure if Pi you showed above
is the answer to the same problem I had.

The analytical answer to

f:=exp(cos(x))*cos(x-sin(x));
int(f,x=0..2*Pi);

should be 2 Pi, not Pi.

--Nasser


Axel Vogt

unread,
Dec 6, 2009, 3:53:11 PM12/6/09
to

Much better than my way ...

Fırat

unread,
Dec 8, 2009, 3:44:32 PM12/8/09
to

I want to ask new integral such as

f:=(t-a)^c/(b-t)^d; #a,b,c,d are contant

How can I found analytical integral solution

Firat

G. A. Edgar

unread,
Dec 9, 2009, 8:19:35 AM12/9/09
to
In article
<59c20e76-4591-4522...@v25g2000yqk.googlegroups.com>,
F�rat <agim...@gmail.com> wrote:

Well, int(t^c*(1-t)^d,t=0..1); is the Beta function.
Change variables x=(t-a)/(b-a) to reduce yours to the case a=0, b=1.
Then since yours is the indefinite integral, it would be called an
"incomplete Beta function" I suppose. Maple reports
Int(x^c*(1-x)^(-d), x) = x^(c+1)*hypergeom([d, c+1], [2+c], x)/(c+1)

--
G. A. Edgar http://www.math.ohio-state.edu/~edgar/

Fırat

unread,
Dec 10, 2009, 9:01:09 AM12/10/09
to
On 9 Aralık, 15:19, "G. A. Edgar" <ed...@math.ohio-state.edu.invalid>
wrote:
> In article
> <59c20e76-4591-4522-b099-c3e09115f...@v25g2000yqk.googlegroups.com>,
>
>
>
>
>
> Fžrat <agimfi...@gmail.com> wrote:

> > On 6 Aralžk, 22:53, Axel Vogt <&nore...@axelvogt.de> wrote:
> > > Rouben Rostamian wrote:
> > > > On 2009-12-06, Nasser M. Abbasi <n...@12000.org> wrote:
> > > >> Maple 12
> > > >> Can do this integral numerically, but not analytically:
>
> > > >>> restart;
> > > >> f:=exp(cos(x))*cos(x-sin(x));
> > > >> int(f,x=0..2*Pi);
>
> > > > Maple 11, 12, 13 can do it if we expand f first:
>
> > > >    int(expand(f), x=0..2*Pi);
>
> > > > The result is 2*Pi.
>
> > > Much better than my way ...
>
> > I want to ask new integral such as
>
> > f:=(t-a)^c/(b-t)^d;   #a,b,c,d are contant
>
> > How can I found analytical integral solution
>
> > Firat
>
> Well, int(t^c*(1-t)^d,t=0..1); is the Beta function.
> Change variables x=(t-a)/(b-a) to reduce yours to the case a=0, b=1.
> Then since yours is the indefinite integral, it would be called an
> "incomplete Beta function" I suppose.  Maple reports
> Int(x^c*(1-x)^(-d), x) = x^(c+1)*hypergeom([d, c+1], [2+c], x)/(c+1)
>
> --
> G. A. Edgar                              http://www.math.ohio-state.edu/~edgar/- Alıntıyı gizle -
>
> - Alıntıyı göster -


Thanks for your answer. But I have some problem. I wrote my maple file
as you say in the following form:

with(student):
F:=Int((t-a)^c/(b-t)^d,t);

/ c
| (t - a)
F := | -------- dt
| d
/ (b - t)

> changevar(x=(t-a)/(b-a),F,x);

/ c
| (x b - x a) (b - a)
| -------------------- dx
| d
/ (b - a - x b + x a)

> evalf(%);

/ c
| (x b - 1. x a) (b - 1. a)
| -------------------------- dx
| d
/ (b - 1. a - 1. x b + x a)

but it does not give any answer. Main problem is: this integral form
appear in my iteration statement and I have to use this integral value
for new iteration after previous iteration. I want to integrate this
function and get numerical value.

Is this possible?

Firat

Fırat

unread,
Dec 10, 2009, 9:05:16 AM12/10/09
to
> > G. A. Edgar                              http://www.math.ohio-state.edu/~edgar/-Alıntıyı gizle -
> Firat- Alıntıyı gizle -
>
> - Alıntıyı göster -

I forget that the power c and d are non-intager value

Ray Vickson

unread,
Dec 10, 2009, 1:38:22 PM12/10/09
to
> > G. A. Edgar                              http://www.math.ohio-state.edu/~edgar/-Alıntıyı gizle -

>
> > - Alıntıyı göster -
>
> Thanks for your answer. But I have some problem. I wrote my maple file
> as you say in the following form:
>
> with(student):
> F:=Int((t-a)^c/(b-t)^d,t);
>
>                                 /        c
>                                |  (t - a)
>                          F :=  |  -------- dt
>                                |         d
>                               /   (b - t)
>
> > changevar(x=(t-a)/(b-a),F,x);
>
>                        /            c
>                       |  (x b - x a)  (b - a)
>                       |  -------------------- dx
>                       |                     d
>                      /   (b - a - x b + x a)
>
> > evalf(%);

You cannot get a numerical answer unless you specify numerical values
for a, b, c and the integration limits. Maple cannot read your mind.

>
>                     /               c
>                    |  (x b - 1. x a)  (b - 1. a)
>                    |  -------------------------- dx
>                    |                           d
>                   /   (b - 1. a - 1. x b + x a)
>
> but it does not give any answer. Main problem is: this integral form
> appear in my iteration statement and I have to use this integral value
> for new iteration after previous iteration. I want to integrate this
> function and get numerical value.

You can write answer_above = (b-a)^(c+1-d) * int(x^c/(1-x)^d,x), and
then express this last integral in terms of an incomplete beta
function (or a hypergeometric function, as Maple seems to prefer).

>
> Is this possible?

Of course not. You have not said what are the values of a, b, c and
the integration limits.

R.G. Vickson

>
> Firat

Fırat

unread,
Dec 10, 2009, 4:20:43 PM12/10/09
to
> > Firat- Alıntıyı gizle -
>
> - Alıntıyı göster -- Alıntıyı gizle -
>
> - Alıntıyı göster -

In my previous message I said the power c and d are non-integer value.
I give some values as you say but it does not evulate integral for
example

>c:=0.3, d:=0.5;
>int(x^c/(1-x)^d,x);

Ray Vickson

unread,
Dec 10, 2009, 8:40:02 PM12/10/09
to
Here is what I get using Maple 9.5:
restart;params:={c=0.3,d=0.5};

params := {c = 0.3, d = 0.5}

> J:=int(x^c/(1-x)^d,x);

(c + 1)
x hypergeom([d, c + 1], [2 + c], x)
J := ------------------------------------------
c + 1

J1:=subs(params,J);

1.3
J1 := 0.7692307692 x hypergeom([0.5, 1.3], [2.3], x)

Of course, if we give numerical values for the integration limits we
will get a numerical evaluation:
J2:=subs(params,int(x^c/(1-x)^d,x=0 .. .97)): value(J2);
1.362551855


R.G. Vickson


Fırat

unread,
Dec 11, 2009, 8:53:32 AM12/11/09
to
> R.G. Vickson- Alıntıyı gizle -
>
> - Alıntıyı göster -


Thanks for your kindly help and understanding. I am beginner in Maple.
I want to ask a question. I want to use the first example in Maplesoft
webpage

http://www.maplesoft.com/support/help/AddOns/view.aspx?path=Student%2fNumericalAnalysis%2fInitialValueProblem

I wrote as follow

>with(Student(NumericalAnalysis));
`Error, NumericalAnalysis is not a command in the Student package\n`

and give above error message.

I want write this in Maple 10 classical worksheet. Please let me know
where I did wrong.

Firat

Robert Israel

unread,
Dec 11, 2009, 6:36:09 PM12/11/09
to
=?UTF-8?B?RsSxcmF0?= <agim...@gmail.com> writes:


> Thanks for your kindly help and understanding. I am beginner in Maple.
> I want to ask a question. I want to use the first example in Maplesoft
> webpage
>
>

>http://www.maplesoft.com/support/help/AddOns/view.aspx?path=3DStudent%2fNum=


> ericalAnalysis%2fInitialValueProblem
>
> I wrote as follow
>
> >with(Student(NumericalAnalysis));
> `Error, NumericalAnalysis is not a command in the Student package\n`

I hope what you wrote was actually

with(Student[NumericalAnalysis]);

> and give above error message.
>
> I want write this in Maple 10 classical worksheet. Please let me know
> where I did wrong.

The NumericalAnalysis subpackage was first introduced in Maple 13. It
does not exist in Maple 10.
--
Robert Israel isr...@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

Bill

unread,
Dec 11, 2009, 6:55:14 PM12/11/09
to

> > Maple 11, 12, 13 can do it if we expand f first:
>
> >    int(expand(f), x=0..2*Pi);
>
> > The result is 2*Pi.

Actually, a little simplify will produce the desired result directly:

y := exp(cos(x))*cos(x-sin(x)):
ti := int(y, x=0..2*Pi):
simplify(ti, [trig]);
2 Pi

Bill

Fırat

unread,
Dec 12, 2009, 5:51:22 AM12/12/09
to
On 12 Aralık, 01:36, Robert Israel
<isr...@math.MyUniversitysInitials.ca> wrote:

> =?UTF-8?B?RsSxcmF0?= <agimfi...@gmail.com> writes:
> > Thanks for your kindly help and understanding. I am beginner in Maple.
> > I want to ask a question. I want to use the first example in Maplesoft
> > webpage
>
> >http://www.maplesoft.com/support/help/AddOns/view.aspx?path=3DStudent...

> > ericalAnalysis%2fInitialValueProblem
>
> > I wrote as follow
>
> > >with(Student(NumericalAnalysis));
> > `Error, NumericalAnalysis is not a command in the Student package\n`
>
> I hope what you wrote was actually
>
>   with(Student[NumericalAnalysis]);
>
> > and give above error message.
>
> > I want write this in Maple 10 classical worksheet. Please let me know
> > where I did wrong.
>
> The NumericalAnalysis subpackage was first introduced in Maple 13.  It
> does not exist in Maple 10.
> --
> Robert Israel              isr...@math.MyUniversitysInitials.ca
> Department of Mathematics        http://www.math.ubc.ca/~israel
> University of British Columbia            Vancouver, BC, Canada


Thanks for your answer

Archimedes

unread,
Dec 13, 2009, 11:37:13 AM12/13/09
to

Using simplify with the trig option is square brackets is equivalent
to issuing the command "expand" first, and then simplifying the
output. So simplify(ti, trig); is not the same as simplify(ti,
[trig]); Is this documented somewhere? I did not see this in the
help pages for simplify, or simplify/siderels

Regards,
Georgios

Bill

unread,
Dec 14, 2009, 6:32:26 PM12/14/09
to
On Dec 13, 11:37 am, Archimedes <gkoko...@yahoo.com> wrote:

>
> Using simplify with the trig option is square brackets is equivalent
> to issuing the command "expand" first, and then simplifying the
> output.  So simplify(ti, trig); is not the same as simplify(ti,
> [trig]);  Is this documented somewhere?  I did not see this in the
> help pages for simplify, or simplify/siderels
>
> Regards,
> Georgios

I agree that the help pages don't explain this well. If you want to
see what the difference is, try executing
> trace(simplify)
and then run the other commands. It's quite a bit different. Also try
'expand. to see how it calls 'simplify.'

Bill
Mele Kalikimaka to all

0 new messages