Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

In[ ]:= eqn = y '[t] - t ^ 2 ⩵ 0;

soln = DSolve[eqn, y[t], t]

t3
Out[ ]= y[t] → + C[1]
3

In[ ]:= Plot[x ^ 2, {x, - 10, 10}]

100

80

60

Out[ ]=

40

20

-10 -5 5 10

In[ ]:= eqn = y '[t] - t ^ 2 + 1 ⩵ 0;


DSolve[eqn, y[t], t]
t3
Out[ ]= y[t] → - t + + C[1]
3

In[ ]:= ClearALL[y, x]


eqn = y '[x] - x ^ 2 ⩵ 0
soln = DSolve[eqn, y[x], x]
Out[ ]= ClearALL[y, x]

Out[ ]= - x2 + y′ [x] ⩵ 0

x3
Out[ ]= y[x] → + C[1]
3

In[ ]:= uniq = Expand[DSolve[{eqn, y[10] ⩵ 10}, y[x], x]}


2 BPS21018.nb

QUESTION - 1

In[ ]:= eqn = y '[t] ⩵ t ^ 2 - 1;


soln = DSolve[eqn, y[t], t]
t3
Out[ ]= y[t] → - t + + C[1]
3

UNIQUE SOLUTION
In[ ]:= uniq = Expand[DSolve[{eqn, y[0] ⩵ 2}, y[t], t]]
t3
Out[ ]= y[t] → 2 - t + 
3

In[ ]:= PLOTTING OF GRAPH

PlotEvaluatey[t] = 2 - t + t ^ 3  3, {t, - 5, 5}


Out[ ]= GRAPH OF PLOTTING

40

20

Out[ ]=
-4 -2 2 4

-20

In[ ]:= QUESTION 2


ClearAll[y, t]
eqn = y ''[t] + y[t] ⩵ 0;
soln = DSolve[eqn, y[t], t]
Out[ ]= 2 QUESTION

Out[ ]= {{y[t] → C[1] Cos[t] + C[2] Sin[t]}}

In[ ]:= uniq = DSolve[{eqn, y[1] ⩵ 2, y '[1] ⩵ - 5}, y[t], t]


Out[ ]= y[t] → Csc[1] 5 Cos[1]2 Cos[t] + 2 Cos[1]2 Cos[t] Cot[1] + 2 Cos[1] Cos[t] Sin[1] +
5 Cos[t] Sin[1]2 + 2 Cos[1]2 Sin[t] - 5 Cos[1]2 Cot[1] Sin[t] -
5 Cos[1] Sin[1] Sin[t] + 2 Sin[1]2 Sin[t]  1 + Cot[1]2  Cos[1]2 + Sin[1]2 
BPS21018.nb 3

In[ ]:= Plot[Evaluate[y[t] /. soln /. {C[1] → Range[- 3, 3], C[2] → Range[- 3, 3]}], {t, - 10, 4}]

Out[ ]=
-10 -8 -6 -4 -2 2 4

-2

-4

In[ ]:= Practical4


ClearAll[y, x]
eqn = y '''[x] + 3 y ''[x] + 4 y '[x] + 12 y[x] ⩵ 0;
soln = DSolve[eqn, y[x], x]
Out[ ]= Practical4

Out[ ]= y[x] → ⅇ-3 x C[3] + C[1] Cos[2 x] + C[2] Sin[2 x]

In[ ]:= Plot[Evaluate[y[x] /. soln /. {C[1] → 1, C[2] → 2, C[3] → Range[- 3, 3]}],


{x, - 5, 4}, PlotRange → {- 20, 20} ImageSize → Large,
Axes → True, AxesLabel → {"X", "Y"}, Background → Green]
General: Value of option PlotRange -> {-20 ImageSize, 20 ImageSize} → Large is not All, Full, Automatic, a positive machine
number, or an appropriate list of range specifications.
Y
400

200

Out[ ]=
X
-4 -2 2 4

-200

-400
4 BPS21018.nb

In[ ]:= Ques1


ClearAll[y, x]
eqn := y ''[x] + y[x];
f[x_] := Tan[x];
P = DSolve[eqn ⩵ 0, y[x], x]
Out[ ]= Ques1

Out[ ]= {{y[x] → C[1] Cos[x] + C[2] Sin[x]}}

Out[ ]= {{y[x] → C[1] Cos[x] + C[2] Sin[x]}}

In[ ]:= u[x_] := Cos[x];


v[x_] := Sin[x];
w = SimplifyDet u[x] v[x] 
u '[x] v '[x]
Out[ ]= 1

In[ ]:= g[x_] := - v[x] f[x]  w


h[x_] := u[x] f[x]  w
G = Integrate[g[x], x]
x x x x
Out[ ]= LogCos  - Sin  - LogCos  + Sin  + Sin[x]
2 2 2 2

In[ ]:= H = Simplify[Integrate[h[x], x]]

- Cos[x]

PRACTICAL {1}

Q[1]

eqn = y '[t] - t ^ 2 ⩵ 0;
soln = DSolve[eqn, y[t], t]

t3
y[t] → + C[1]
3
uniq = Expand[DSolve[{eqn, y[0] ⩵ - 3}, y[t], t]]

t3
y[t] → - 3 + 
3
Y[t_] = - 3 + t ^ 3  3;
Plot[{Y[t], Y '[t]}, {t, - 5, 5}, PlotStyle → {Red, Blue},
PlotRange → {- 5, 20}, PlotLegends → {"Y(t)", "Y'(t)"},
Axes → True, AxesLabel → {"X-axis", "Y-axis"}]

Y-axis
20
15
Y(t)
10
X-axis Y'(t)
-4-2 2 4
BPS21018.nb 5

Q[2]
ClearAll[y, t]
eqn = y '[t] - t ^ 2 + 1 ⩵ 0;
soln = DSolve[eqn, y[t], t]
t3
y[t] → - t + + C[1]
3
uniq = Expand[DSolve[{eqn, y[0] ⩵ 2}, y[t], t]]

t3
y[t] → 2 - t + 
3
Y[t_] = 2 - t + t ^ 3  3;
Plot[{Y[t], Y '[t]}, {t, - 5, 5}, PlotStyle → {Red, Blue},
PlotRange → {- 5, 20}, PlotLegends → {"Y(t)", "Y'[(t)"},
Axes → True, AxesLabel → {"X-axis", "Y-axis"}]
Y-axis
20
15
Y(t)
10
X-axis Y'[(t)
-4-2 2 4

Q[3]

ClearAll[y, x]
eqn = y '[x] - x ^ 2 ⩵ 0;
soln = Expand[DSolve[eqn, y[x], x]]
x3
y[x] → + C[1]
3
uniq = Expand[DSolve[{eqn, y[10] ⩵ 10}, y[x], x]]
970 x3
y[x] → - + 
3 3
y1 = y[x] /. soln /. {C[1] → - 50};
y2 = y[x] /. soln /. {C[1] → 0};
y3 = y[x] /. soln /. {C[1] → 50};
y4 = y[x] /. soln /. {C[1] → - 100};
y5 = y[x] /. soln /. {C[1] → 100};
Plot[{y1, y2, y3, y4, y5}, {x, - 20, 20}, PlotRange → {- 700, 700},
PlotLegends → "Expressions", ImageSize → Large]
6 BPS21018.nb

600

400

-50 +
200
x3
3
x
50 +
-20 -10 10 20

-100
-200

100 +

-400

-600

Plot[Evaluate[y[x] /. soln /. C[1] → Range[- 50, 50]], {x, - 20, 20}]


3000
2000
1000
-20 -10 10 20
-2000
-3000

Q[4]

ClearAll[y, x]
eqn = y '[x] - 6 x * y[x] - 1 ^ 2  3 ⩵ 0;
soln = Expand[DSolve[eqn, y[x], x]]
1 C[1]3
y[x] → 1 + x6 + x4 C[1] + x2 C[1]2 + 
3 27
Plot[Evaluate[y[x] /. soln /. C[1] → Range[- 8, 4]], {x, - 3, 3}, PlotRange → {- 20, 10},
ImageSize → Large, Axes → True, AxesLabel → {"X", "Y"}, Background → White]
BPS21018.nb 7

Y
10

X
-3 -2 -1 1 2 3

-5

-10

-15

-20

Syntax::sntxf: "soln=Expand[" cannot be followed by "DSolve[eqn,y[x],x]}".

You might also like