From: Paul on
Hello.
I want to find value of integral from 0 to 1 exp(t*sin(x))*dx
with function int I can find integral from 0 to 1 exp(sin(x))*dx
But if I add independent variable t, than I receive an error from function int()

How can I evaluate that integral?
Thank you.
From: Walter Roberson on
Paul wrote:

> I want to find value of integral from 0 to 1 exp(t*sin(x))*dx
> with function int I can find integral from 0 to 1 exp(sin(x))*dx
> But if I add independent variable t, than I receive an error from
> function int()
>
> How can I evaluate that integral?

My speculation would be that you are not telling int() which variable to
integrate over.

Show us how you are calling int() and any critical code leading up to that.
From: Paul on
Walter Roberson <roberson(a)hushmail.com> wrote in message <wSo6o.57866$YX3.28517(a)newsfe18.iad>...
> Paul wrote:
>
> > I want to find value of integral from 0 to 1 exp(t*sin(x))*dx
> > with function int I can find integral from 0 to 1 exp(sin(x))*dx
> > But if I add independent variable t, than I receive an error from
> > function int()
> >
> > How can I evaluate that integral?
>
> My speculation would be that you are not telling int() which variable to
> integrate over.
>
> Show us how you are calling int() and any critical code leading up to that.
syms x t;
int(exp(-t*sin(x)),x,0,1)
From: Rogelio on
"Paul " <unicybsatr(a)gmail.com> wrote in message <i3dnp8$5gg$1(a)fred.mathworks.com>...
> Walter Roberson <roberson(a)hushmail.com> wrote in message <wSo6o.57866$YX3.28517(a)newsfe18.iad>...
> > Paul wrote:
> >
> > > I want to find value of integral from 0 to 1 exp(t*sin(x))*dx
> > > with function int I can find integral from 0 to 1 exp(sin(x))*dx
> > > But if I add independent variable t, than I receive an error from
> > > function int()
> > >
> > > How can I evaluate that integral?
> >
> > My speculation would be that you are not telling int() which variable to
> > integrate over.
> >
> > Show us how you are calling int() and any critical code leading up to that.
> syms x t;
> int(exp(-t*sin(x)),x,0,1)

Hi Paul,
As I understand what you want is a numerical integration. If what you want is that then you should use the function "quad" (or similars). I am assuming that "t" in your funcion is not a variable.
t=10;
f=@(x)exp(-t*sin(x));
quad(f,0,1)
ans=
0.1011
From: us on
On Aug 5, 9:04 am, "Paul " <unicybs...(a)gmail.com> wrote:
> Walter Roberson <rober...(a)hushmail.com> wrote in message <wSo6o.57866$YX3..28...(a)newsfe18.iad>...
> > Paul wrote:
>
> > > I want to find value of integral from 0 to 1  exp(t*sin(x))*dx
> > > with function int I can find integral from 0 to 1  exp(sin(x))*dx
> > > But if I add independent variable t, than I receive an error from
> > > function int()
>
> > > How can I evaluate that integral?
>
> > My speculation would be that you are not telling int() which variable to
> > integrate over.
>
> > Show us how you are calling int() and any critical code leading up to that.
>
> syms x t;
> int(exp(-t*sin(x)),x,0,1)

well...
these work (r2010a)...
which error(s) do you receive(?)...

syms x t;
int(exp(-t*sin(x)),x,0,1)
% Warning: Explicit integral could not be found.
% ans = int(1/exp(t*sin(x)), x = 0..1)

int(exp(-t*sin(x)),t,0,1)
% ans = -(1/exp(sin(x)) - 1)/sin(x)


us