Message Boards Message Boards

0
|
5203 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Check whether a function is a solution to this differential equation?

Posted 7 years ago

Experiment 22.1

In each of the following, you are given a differential equation and a function y=f(x). Following the procedure of Section 22.1, check in each case whether the function is a solution to the differential equation.

1.  x y'=3 y +x^4 cos x, y=x^3 sin x.
2.  x y'=3 y +x^4 cos x, y=x^2 sin x.
3.  x^2 y''-x y'+y=ln x, y=x ln x+ln x +2.
4.  x^2 y''+x y'+y=0,  y= cos(ln x) + sin(ln x).
5.  x^3(y')^2+x^2 y y'+4=0, y=-(x+4)/x.
6.  (y')^2+x y=e^x, y=e^x-e^-x.

1.

Clear[f, y, x, left, right]

f[x_] := x^3*Sin[x]

left[y_] := x*y'[x]

right[y_] := 3*y[x]

In[19]:= Simplify[left[f]]

Out[19]= left[f]

2.

Clear[f, y, x, left, right]

f[x_] := x^2*Sin[x]

left[y_] := x*y'[x]

right[y_] := 3*y + x^4*Cos[x]

In[13]:= Simplify[left[f]]

Out[13]= left[f]

3.

Clear[f, y, x, left, right]

f[x_] := x*Log[x] + Log[x] + 2

left[y_] := x^2*y''[x] - x*y'[x] + y[x]

right[y_] := Log[x]

[left[f]]

Log[x]
  1. Clear[f, x, y, left, right]
    
    f[x_] := Cos[Log[x]] + Sin[Log[x]]
    
    left[y_] := x^2*y''[x] + x*y'[x] + y[x]
    
    right[y_] := 0
    
    In[11]:= [left[f]]
    

During evaluation of In[11]:= Syntax::tsntxi: "[left[f]]" is incomplete; more input is needed.

5.

Clear[f, x, y, left, right]

f[x_] := -[x + 4]/x

left[y_] := x^3*[y'[x]]^2 + x^2*y[x]*y'[x] + 4

right[y_] := 0

Simplify[left[f]]

left[f]
  1. Clear[f, x, y, left, right]

    f[x_] := E^[x] - E^[-x]

    left[y_] := [y'[x]]^2 + x*y'[x]

    right[y_] := E^[x]

    Simplify[left[f]]

    left[f]

POSTED BY: Brianna Cimino
4 Replies

This sort of thing should go to an instructor or TA rather than a forum, but I'll show one such.

First, it pays to use code that actually corresponds to the exercise. The value for right was missing a needed term. Second, these are funcions of the independent variable x, not y. I realize it's a dummy variable, but since y is used as dependent variable it makes things very confusing to have definitions using that as the dummy variable; now the sort of thing to do unless one is fairly experienced using the Wolfram Language in calculus.

left[x_] := x*y'[x]
right[x_] := 3*y[x] + x^4*Cos[x]

Third is to recognize that the assignment asks to verify a solution. Call it f[x] for now, and we'll plug it into y to see if it is valid.

f[x_] := x^3*Sin[x]
pluggedIn = left[x] - right[x] /. y -> f

(* Out[309]= -x^4 Cos[x] - 3 x^3 Sin[x] + x (x^3 Cos[x] + 3 x^2 Sin[x]) *)

Is this zero?

Simplify[pluggedIn]

(* Out[310]= 0 *)
POSTED BY: Daniel Lichtblau

The most plausible way to get that result is if the functions left and right were never defined. What exactly have you entered? What definitions might you have failed to enter? This is the sort of thing one should find by carefully checking one's work, not by posting to a forum.

POSTED BY: Daniel Lichtblau
Posted 7 years ago

I appreciate your help. However, I am getting the out as left[x]-right[x] now

POSTED BY: Brianna Cimino

You may try the following approach:

In[1]:= y[x_] := x^3 Sin[x]

In[2]:= x y'[x] == 3 y[x] + x^4 Cos[x] // Simplify
Out[2]= True
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract