Discussion:
Differential Equation
(too old to reply)
Zohreh
2014-04-29 05:33:05 UTC
Permalink
Dear Friends,

I am going to solve the following differential equation:
dY(x)/dx=A*f(x)-B*Y(x)

In which A and B are some parameters, f(x) is a function of x, and Y(C)=0 (C is a parameter).

I tried to solve it in Mathematica by
DSolve[Y'[x] == A*f[x] - B*Y[x], Y[C] == 0, x]

But I get the following error
DSolve::dsfun: "Y[C]==0 cannot be used as a function

I would highly appreciate it if somebody can help me.

Best regards.
Murray Eisenberg
2014-04-30 05:41:31 UTC
Permalink
Did you make any attempt whatsoever to consult the documentation for the proper syntax of DSolve? The correct syntax is

DSolve[{eqn1, eqn2, ...}, y, x]

or

DSolve[{eqn1, eqn2, ...}, y[x], x]

In your case:

DSolve[{Y'[x] == A*f[x] - B*Y[x], Y[C] == 0}, Y[x], x]

Actually, you should avoid using upper-case letters for your own names, since built-in Mathematica names begin with such. Thus it would be much safer to use:

DSolve[{y'[x] == a f[x] - b y[x], y[c] == 0}, y[x], x]
Post by Zohreh
dY(x)/dx=A*f(x)-B*Y(x)
In which A and B are some parameters, f(x) is a function of x, and Y(C)=0 (C is a parameter).
I tried to solve it in Mathematica by
DSolve[Y'[x] == A*f[x] - B*Y[x], Y[C] == 0, x]
But I get the following error
DSolve::dsfun: "Y[C]==0 cannot be used as a function
I would highly appreciate it if somebody can help me.
Murray Eisenberg ***@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 240 246-7240 (H)
University of Massachusetts
710 North Pleasant Street
Amherst, MA 01003-9305
psycho_dad
2014-04-30 05:39:49 UTC
Permalink
Hi,
The correct syntax is this:
DSolve[{Y'[x] == A*f[x] - B*Y[x], Y[C] == 0}, Y[x], x]

Notice the brackets {} and the Y[x]. See the help of DSolve for more examples etc.

Cheers
David Reiss
2014-04-30 05:41:52 UTC
Permalink
Check the syntax for the proper use of DSolve. You are looking for

DSolve[{Y'[x] == A*f[x] - B*Y[x], Y[C] == 0}, Y, x]

Also note that C is a reserved symbol in Mathematica. Generally you should avoide using capital letters for your parameters and functions
Post by Zohreh
Dear Friends,
dY(x)/dx=A*f(x)-B*Y(x)
In which A and B are some parameters, f(x) is a function of x, and Y(C)=0 (C is a parameter).
I tried to solve it in Mathematica by
DSolve[Y'[x] == A*f[x] - B*Y[x], Y[C] == 0, x]
But I get the following error
DSolve::dsfun: "Y[C]==0 cannot be used as a function
I would highly appreciate it if somebody can help me.
Best reards.
C
Bill Rowe
2014-04-30 05:40:51 UTC
Permalink
Post by Zohreh
dY(x)/dx=A*f(x)-B*Y(x)
In which A and B are some parameters, f(x) is a function of x, and
Y(C)=0 (C is a parameter).
I tried to solve it in Mathematica by DSolve[Y'[x] == A*f[x] -
B*Y[x], Y[C] == 0, x]
But I get the following error DSolve::dsfun: "Y[C]==0 cannot be used
as a function
I would highly appreciate it if somebody can help me.
=46irst, it is unwise to use a single capital letter as a variable
name as many already have built-in meaning such as C. But, this
isn't the specific problem with your example.

Second, did you look at the documentation for DSolve? If you do,
you will notice the second argument needs to be a function not
an equation. So, try

DSolve[y'[x] == a*f[x] - b*y[x] && y[c] == 0, y[x], x]
Bob Hanlon
2014-04-30 05:40:30 UTC
Permalink
Use correct syntax for DSolve

DSolve[{Y'[x] == A*f[x] - B*Y[x], Y[C] == 0}, Y[x], x]


{{Y[x] -> (-E^((-B)*x))*
(Integrate[A*E^(B*K[1])*
f[K[1]], {K[1], 1,
C}] - Integrate[
A*E^(B*K[1])*f[K[1]],
{K[1], 1, x}])}}


I also recommend that you avoid using capital letters for, or to start,
user-defined names to avoid potential naming conflicts with Mathematica's
built-in symbols.



Bob Hanlon
Post by Zohreh
Dear Friends,
dY(x)/dx=A*f(x)-B*Y(x)
In which A and B are some parameters, f(x) is a function of x, and Y(C)=0
(C is a parameter).
I tried to solve it in Mathematica by
DSolve[Y'[x] == A*f[x] - B*Y[x], Y[C] == 0, x]
But I get the following error
DSolve::dsfun: "Y[C]==0 cannot be used as a function
I would highly appreciate it if somebody can help me.
Best regards.
Zohreh
2014-05-02 06:19:16 UTC
Permalink
Post by Zohreh
Dear Friends,
dY(x)/dx=A*f(x)-B*Y(x)
In which A and B are some parameters, f(x) is a function of x, and Y(C)=0 (C is a parameter).
I tried to solve it in Mathematica by
DSolve[Y'[x] == A*f[x] - B*Y[x], Y[C] == 0, x]
But I get the following error
DSolve::dsfun: "Y[C]==0 cannot be used as a function
I would highly appreciate it if somebody can help me.
Best regards.
Thanks to all for your help.

Best regards.

Loading...