## 449 Reputation

17 years, 90 days

## Modification....

I modified the "beginning" of your code which should move you a little forward.

restart;
ode2 := x^2*(diff(y(x), `\$`(x, 2)))+x*(diff(y(x), x))+4*y(x) = -2*x+7;

bc2 := y(a) = 7, y(b) = -1:
ic2 := bc2[1], (D(y))(a) = alpha:
a := 1: b := 4:

first shot:

a0 := 0:
y0 := unapply(rhs(dsolve(subs(alpha = a0, {ic2, ode2}))), x);

second shot:

a1 := 1:
y1 := unapply(rhs(dsolve(subs(alpha = a1, {ic2, ode2}))), x);

## Modification....

I modified the "beginning" of your code which should move you a little forward.

restart;
ode2 := x^2*(diff(y(x), `\$`(x, 2)))+x*(diff(y(x), x))+4*y(x) = -2*x+7;

bc2 := y(a) = 7, y(b) = -1:
ic2 := bc2[1], (D(y))(a) = alpha:
a := 1: b := 4:

first shot:

a0 := 0:
y0 := unapply(rhs(dsolve(subs(alpha = a0, {ic2, ode2}))), x);

second shot:

a1 := 1:
y1 := unapply(rhs(dsolve(subs(alpha = a1, {ic2, ode2}))), x);

## Yb....

There are several unclarities to me, but the first: What is (or should be) Yb?

## Yb....

There are several unclarities to me, but the first: What is (or should be) Yb?

## Functions without parameters....

There are functions (sin, cos, tan) without parameters. For example: cos (45567) - you have a space there, somewhere the parameters are completely missing.

The other thing: How did you get such an "equation"?

How did you get this? You wanted to calculate the area for given m I suppose. So why is your answer m=something?

## Real number....

m can also be negative. So we can reach the same result with:

int((x-m^2)/(x+1),x=0..m^2) assuming m::real;

## Real number....

m can also be negative. So we can reach the same result with:

int((x-m^2)/(x+1),x=0..m^2) assuming m::real;

## What kind of help?...

You wrote that you wanted to learn how to write procedures, so I would like to ask what kind of help you need? I suppose you know about ?proc. You can start with something more simple. Programming Guide should help as well.

## Problem....

@Danik Well, I don't know where you are stuck at. Do you know (exactly) what to do, but do not know how to do it in Maple? If you have some concrete instructions what to do I would recommend to post new question.

## Problem....

@Danik Well, I don't know where you are stuck at. Do you know (exactly) what to do, but do not know how to do it in Maple? If you have some concrete instructions what to do I would recommend to post new question.

## Further changes....

Yesterday I was not able to compute the general solution "immediately" by dsolve command, so I made some workaround there. I don't know what I was doing wrong, but today it works fine... :)

So in a "different way" part, there can be also sol2 and sol3 computed much easilly, only by the dsolve command:

eq := m*(diff(u(t), t, t))+k*u(t) = -4*p[0]*(t-(1/2)*x)/x:
sol2 := unapply(simplify(rhs(dsolve([eq, u((1/2)*x) = 0, (D(u))((1/2)*x) = 0]))), t, x);

and sol3 similarly. When I was looking at it (now), I found out there is also a typo (in the "different way" part) - when assigning to frameani2 there is a wrongly placed round bracket in the parameters of ball

I hope that's all. :)

## Further changes....

Yesterday I was not able to compute the general solution "immediately" by dsolve command, so I made some workaround there. I don't know what I was doing wrong, but today it works fine... :)

So in a "different way" part, there can be also sol2 and sol3 computed much easilly, only by the dsolve command:

eq := m*(diff(u(t), t, t))+k*u(t) = -4*p[0]*(t-(1/2)*x)/x:
sol2 := unapply(simplify(rhs(dsolve([eq, u((1/2)*x) = 0, (D(u))((1/2)*x) = 0]))), t, x);

and sol3 similarly. When I was looking at it (now), I found out there is also a typo (in the "different way" part) - when assigning to frameani2 there is a wrongly placed round bracket in the parameters of ball

I hope that's all. :)

1) You didn't have correctly typed the procedure, more specifically the variables which you wanted to return from the procedure.

2) There were too many square brackets in the display command (when assigning to frameani1,...,frameani3).

3) You don't need to compute the solution everytime by dsolve (i.e. evaluating the procedure sol). The solution can be obtained generally for arbitrary x. Computing the general solution first and then evaluating it for given x is much faster then calling dsolve everytime. That's why I inserted some commands denoted as different way.