'NDER FUNCTION (1ST DERIVATIVE AT N)
'BY TOSHIHIRO HORIE '96
DEFDBL A-Z
CONST E = 2.7182818#
CONST PI = 3.14159265358#
'GOSUB EQUATION: 'get n value
n = 2: DX = 1 / 1048576
CLS
MAIN:
X = n - DX: GOSUB EQUATION: y1 = y
X = n + DX: GOSUB EQUATION: y2 = y
X = n: GOSUB EQUATION: fx = y
nder = (y2 - y1) / (DX * 2)
PRINT "Derivative of f(x) at "; n; " is "; nder; "."
PRINT "Point of tangency: ("; n; ","; fx; ")"
PRINT "Y-intercept of tan line is "; fx - n * nder
END
EQUATION:
y = (X ^ 3 - 4 * X * X + 8) * E ^ (COS(X ^ 2))
RETURN