Name : Nursyahadah Hasibuan
NIM : 4182121007
Class : Bilingual Physics Education 2018
Graph of Quadratic Functions
1. Coding Equation of Quadratic Function
%Quadratic Function
%y = ax^2 + bx + c
clc;
a=input(' Value a = ');
b=input(' Value b = ');
c=input(' Value c= ');
xm=-b/(2*a);
xb=xm-4; %Limit of minimum value of x
xa=xm+4; %Limit of minimum value of y
x=xb:0.1:xa;
y=a*x.^2+b*x+c;
plot(x,y);
grid on
xlabel('x Axis');ylabel('y Axis');
title('Graph of Quadratic Function');
legend('y');
2. Graph with MATLAB and manual
a. Parabola Opens UP using MATLAB
1) Value a = 1
Value b = -6
Value c = 8
2) Value a = 2
Value b = 4
Value c = -6
b. Manual
3. Graph with MATLAB and manual
a. Parabola Opens Down using MATLAB
1) Value a = -2
Value b = 4
Value c = 6
2) Value a = -1
Value b = 2
Value c = 3
b. Manual
4. Graph Parabola Opens Up Imaginer
1) Value a = 6
Value b = -12
Value c = 7
Quadratic equation have no real root or imaginary if D<0
Then b 2−4 ac< 0
−6 2−4 ( 3 )( 5 ) <0
36−60<0
(PROVEN)
2) Value a = 2
Value b = -3
Value c = 6
Quadratic equation have no real root or imaginary if D<0
Then b 2−4 ac< 0
−22−4 ( 1 ) ( 4 )< 0
4−16 <0
(PROVEN)
5. Graph Parabola Opens Down Imaginer
1) Value a = -1
Value b = 4
Value c = -2
Quadratic equation have no real root or imaginary if D<0
Then b 2−4 ac< 0
−22−4 (−2 ) (−2 ) <0
4−16 <0
(PROVEN)
2) Value a = -4
Value b = -2
Value c = -9
Quadratic equation have no real root or imaginary if D<0
Then b 2−4 ac< 0
−12−4 (−5 ) (−8 ) <0
1−160< 0
(PROVEN)
6. Coding 2 Graph of Parabola Intersect
%Graph of Parabola Intersect
clc;
a1=input(' Value a 1 = ');
b1=input(' Value b 1 = ');
c1=input(' Value c 1 = ');
a2=input(' Value a 2 = ');
b2=input(' Value b 2 = ');
c2=input(' Value c 2 = ');
xm1=-b1/(2*a1);
xm2=-b2/(2*a2);
xb1=xm1-4; %Limit of minimum value of x1
xb2=xm2-4; %Limit of minimum value of x2
xa1=xm1+4; %Limit of minimum value of y1
xa2=xm2+4; %Limit of minimum value of y2
x1=xb1:0.1:xa1;
x2=xb2:0.1:xa2;
y1=a1*x1.^2+b1*x1+c1;
y2=a2*x2.^2+b2*x2+c2;
y1==y2;
plot(x1,y1,x2,y2);
grid on
xlabel('x Axis');ylabel('y Axis');
title('Graph of Parabola Intersect');
legend('y1','y2');
Output
Value a 1 = 2
Value b 1 = 4
Value c 1 = 7
Value a 2 = -1
Value b 2 = -4
Value c 2 = 7