## how can i solve Like this example in maple. approx...

Asked by:

how can i solve Like this example in maple. approximate solution differential equation with Rayleigh–Ritz method

## How to stop maple from simplify an integral?...

Asked by:

If I just want to define an itegral and do not want maple to simplify it to a closed form, what should I do?

For example, I want define

s := int(exp(-x^2)*cos(2*x*y), x = 0 .. infinity).

Maple automatically simplify s to

(1/2)*sqrt(Pi)/exp(y^2)

But I want to keep s in integral form.

## How to integrate a function defined by a condition...

Asked by:

I have a function that is defined by a proc command including some conditional statements (if ... then ...). The conditions are so long so that I can not use a piecewise function instead of using proc. The commands in my code are long and I simplify my question as follows:
f := proc(x) local r; r := sin(x)+x*cos(x); if abs(r) < 1/2 then sin(x) else cos(x) end if; end proc;

plot('f'(x), x = -1 .. 1) works fine but the command int(('f')(x), x = -1 .. 1) gives an error:
Error, (in f) cannot determine if this expression is true or false: abs(sin(x)+x*cos(x)) < 1/2

Is there any way (except rewriting the function as a piecewise function) to get rid of the error?

Any help is appreciated.

## Bug in evalf@Int

Let us consider

```restart; Digits := 20; evalf(Int(abs(cos(1/t)), t = 0 .. 0.1e-1), 3);
-0.639e-2```

Pay your attention to the minus sign. Simply no words. Mma produces 0.006377.

evalf@Int.mw

## Why maple can not solve this integral?...

Asked by:

I'm trying to solve this integral, but maple does not show any result.

f := GAMMA(phi)*y^(mu*phi-1)*(1-y)^((1-mu)*phi-1)/(GAMMA(mu*phi)*GAMMA((1-mu)*phi))
int(log(1-y)*f, y = 0 .. 1) assuming phi >0 and 0<mu<1

What is the problem? Is there any way to solve this integral?

## Strange bug in int

by:

I found a strange bug in int.
For some functions f(x), Maple is able to compute the antiderivative (correctly) but refuses to compute the definite integral.
Or, computes the integral over 0..1  and  0..2  but refuses to compute over 1..2.

 > int(exp(x^3), x);  #ok
 (1)
 > int(exp(x^3), x=1..2); #?
 (2)
 > int(exp(x^3), x=1..2, method=FTOC); #??
 (3)
 > int(exp(x^3), x=0..2); #?
 (4)
 > int(exp(-x^3), x);  #ok
 (5)
 > int(exp(-x^3), x=0..2);  #ok
 (6)
 > int(exp(-x^3), x=0..1);  #ok
 (7)
 > int(exp(-x^3), x=1 .. 2);  #???
 (8)

Download !strange-bug-int.mw

## Bug in int,CPV

Maple 2016

Let us consider

```restart; J := int(cos(a*x)^2/(x^2-1), x = -infinity .. infinity, CPV);
-(1/4)*Pi*sin(2*a)*csgn(I*a)-(1/4)*Pi*sin(2*a)*csgn(I/a)```

This result is not true for a=I:

```eval(J, a = I);
0
```

In this case the integral under consideration diverges because of

```cos(I*x)^2;

cosh(x) ^2
```

## Bug in int

The command

`J := int(sin(x)/(x*(1-2*a*cos(x)+a^2)), x = 0 .. infinity)assuming a::real,a^2 <>0;`

outputs

`(infinity*I)*signum(a^3*(Sum(a^_k1, _k1 = 0 .. infinity))-a^2*(Sum(a^_k1, _k1 = 0 .. infinity))-a*(Sum(a^(-_k1), _k1 = 0 .. infinity))+a^2+Sum(a^(-_k1), _k1 = 0 .. infinity)+a)`

which is wrong in view of

```evalf(eval(J, a = 1/2));
Float(undefined) I```

The correct answer is Pi/(4*a)*(abs((1+a)/(1-a))-1) according to G&R 3.792.6. Numeric calculations confirm it.

## Problem with integrating a solution from fsolve...

Asked by:

I have a problem integrating a solution from fsolve.   I read in another post on this forum that the solution was to use unapply.   This works if I then set up the integration as suggested (i.e., without giving the argument to the function), but not if you do it in a way that seems logical to me (i.e.,the first version of the int command marked ‘fails’ below.   if you can plot a function why can’t you integrate it ?).

Anyway the real problem I have is if I want to use the solution found using fsolve as the argument of another function (h below) and then integrate that.  I assume the final line fails because of the same reason the initial attempt to integrate g(x) fails. However, I can’t figure out what the equivalent notation would be if I wanted to omit the ‘x’ variable.   I tried using unapply again, and also putting in quotes, but nothing works.

> restart;

> g:=unapply('fsolve(a*y^2-sin(y),y=2)',a);

> plot('g(x)',x=1..2);

> evalf(Int('g(x)',x=1..2));#this fails

> evalf(Int(g,1..2));#this works fine

> h:=x->x*sin(x);

> h(g(1.0));

> h(g(2.0));

> evalf(Int(h(g(x)),x=1..2));# this fails

## NLP optimization...

Asked by:

I have a nonlinear function Q(a,b,c,d,x,y) and I'd like to get the optimum (x*,y*) for different values of (a,b,c,d). The usual sintax:

NLPSolve(Q(10, 1, 5, 2, x,y), x= 0 .. 50, y = 0 .. 50, initialpoint = {x = 2,y= .5}, assume = nonnegative) does not work when Q contains numerical integration, that is evalf (Int). I have no problem with the definite integral evalf(int). The problem is that most of the cases required numerical integration so I need the former expression.

I'd appreciate very much if someone could help me.

## Problem with plot...

Asked by:

y := int(1/(-0.4016e-1*m^(2/3)-0.211e-3*m^(5/3)), m)

I have to  draw  plot m against y. I can draw plot y against m but i don't can draw plot m against y. Please help me.

## How to find this integral?...

Asked by:

Hello people in mapleprimes,

I cannot obtain a proper result from the following code.

a:=int(((beta/beta[1,2])^(-theta/(1-theta))-kappa[1]^(-theta/(1-theta)))*m*beta^(m-1),beta=0 .. kappa[1]*beta[1,2]);

Please tell me if you know how to have maple calculate it.

Thanks in advance.

taro

## Problem with complicated ODE...

Asked by:

Hi All,

I'm trying to numerically solve a differential equation which has a numeric function in it.

For example, consider the function f.

f:=(r)-> evalf(Int( <some messy function>, <some range>)) ;  <- This can be solved numerically and returns an answer quickly. i.e

f(23) gives 102;

Now, I want to numericaly solve something like.

Eq:= diff(p(r),r,r) + diff(p(r),r) - f(p(r));

ICS:=D(p)(0.001)=0, p(0.001) = 3

dsolve({Eq,ICS},numeric).

dsolve will not attempt to solve it due to the numeric integration in f. Is there a way I can just use numeric techniques to solve this kind of problem?

Thanks in advance.

## Problem with indefinite integral...

Asked by:

Maple 2016.

Why does

int(sqrt(c+d*tan(e+f*x))*(a+b*tan(e+f*x))^(5/2),x);

Causes mserver.exe to hang into a loop at full CPU and maple hangs?

Windows 7, 64 bit.  Even using timelimit() on it, it still hangs exceeding the time limit and never return. I have to kill mserver.exe or exit Maple to recover.

## Problem in Integration...

Asked by:

Hello dears! Hope all you are fine. I am facing problem to integrate some expression please see the attachment and fix the problem. I am very thankful for your favour.

Integration.mw

Mob #: 0086-13001903838
 1 2 3 4 5 Page 1 of 5
﻿