Const d As Double = 0.01
Const g As Double = 9.8

Function f(x As Double) As Double
    f = g * x
End Function

Function f_2(x As Double) As Double
    f_2 = (f(x + d) - f(x)) / d
End Function

Function f_3(x As Double) As Double
    f_3 = (f_2(x + d) - f_2(x)) / d
End Function

Function fnc_Integral(x1 As Double, x2 As Double) As Double
    Dim n1 As Double
    Dim n2 As Double
    
    If x1 <= x2 Then
        n1 = x1
        n2 = x2
    Else
        n1 = x2
        n2 = x1
    End If
    
    fnc_Integral = 0
    
    Do Until n1 >= n2
        fnc_Integral = fnc_Integral + f(n1) * d * Sgn(n1)
        n1 = n1 + d
    Loop
End Function

Function fnc_Integral_0(x1 As Double, x2 As Double) As Double
    Dim n1 As Double
    Dim n2 As Double
    
    fnc_Integral_0 = 0
    If x1 <= x2 Then
        n1 = x1
        n2 = x2
    Else
        n1 = x2
        n2 = x1
    End If
    
    Do Until n1 >= n2
        fnc_Integral_0 = fnc_Integral_0 + f_0(n1) * d * Sgn(n1)
        n1 = n1 + d
    Loop
End Function

Function f_0(x As Double, Optional C As Double = 0) As Double
    f_0 = fnc_Integral(0, x) - C
End Function

Function f_00(x As Double, Optional C As Double = 0) As Double
    f_00 = fnc_Integral_0(0, x) - C
End Function