Hypot
06.15
Diposting oleh Melany Christy
Motivation and usage
Calculation of the length of the hypotenuse of a triangle is possible to do using the square root function but hypot(x, y) avoids possible problems with very large or very small numbers.
The magnitude of the hypotenuse from (0, 0) to (x, y) can be calculated using:
However the squares of very large or small values of x and y may exceed the range of machine precision when calculated on a computer, leading to an inaccurate result (see underflow, overflow). The hypot function was designed to calculate the result without causing this problem.
The hypot function may typically be used together with the atan2 function to convert from Cartesian to polar coordinates:
- r = hypot(x, y) θ = atan2(y, x)
Implementation
The difficulty with the naive implementation is that x² or y² may over- or underflow, unless the intermediate result is computed with extended precision. A common implementation technique is to exchange the values, if necessary, so that |x|>|y|, and then use the equivalent form:
The computation of y/x cannot overflow, and underflows compute the correct result. The square root is computed over a value between 1 and 2. Finally, the multiplication by |x| cannot underflow, and overflows only when the result is too large to represent.
Programming language support
The function is present in several programming languages:
- C99
- Apple's PowerPC Numerics [1]
- Matlab[2]
- Pascal [3]
- PHP[4]
- Java (since version 1.5)[5]
Some C90 and C++ libraries have provided a hypot function.
Integral Tertentu
19.05
Diposting oleh Melany Christy
1. Pengertian
Bila suatu fungsi F(x) mempunyai turunan f(x), maka bila f(x) diintegrasikan pada selang (a, b) menjadi
a a
ò c dx = c(x) ï= F(b) - F(a)
b b
2. Sifat
b b
a. ò c dx = c(x) ï = c(b - c) c = konstanta
a a
b a
b. ò f(x) dx = - ò f(x) dx c = batas ditukar
a b
a
c. ò f(x) dx = 0 c = batas sama
a
b a b
d. ò f(x) dx = ò f(x) dx + ò f(x) dx c = ( a <>
a b c
Integral Tak Tentu
19.04
Diposting oleh Melany Christy
INTEGRAL merupakan kebalikan dari differensial (anti differensial).
Jika turunan dari F(x) adalah f(x), maka :
ò f(x) dx = F(x) + c Þ (c = konstanta)
Integral dapat digolongkan atas :
A. Integral tak tentu (Tanpa batas)
B. Integral tertentu (Dengan batas)
1. RUMUS
FUNGSI ALJABAR
ò xn dx = 1/n+1 xn+1 + c ; n ¹ -1
FUNGSI TRIGONOMETRI
ò sin x dx = - cos x + c
ò cos x dx = sin x + c
sifat-sifat:
a. ò c f(x) dx = c ò f(x) dx
b. ò ( f(x) ± g(x) ) dx = ò f(x) dx ± ò g(x) dx
c. jika ò f(x) dx = F(x) + c
maka ò f(ax) dx = 1/a F(ax) + c
ò f(ax+b) dx = 1/a F(ax+b) + c
Perluasan :
ò (ax + b)n dx = 1/a 1/(n+1) (ax + b)n+1 + c
ò sin (ax + b) dx = -1/a cos (ax + b) + c
ò cos (ax + b) dx = 1/a sin (ax + b) + c
CARA MENGINTEGRIR
a. SUBSTITUSI
I = ò f(x) dx
substitusi : x = Q(u) ; dx = Q`(u) du
I = ò f(Q(u)) Q`(u) du
jika ruas kanan telah diintegrir, subtitusi kembali dengan fungsi invers dari x = Q(u)
(ket : Prinsipnya adalah merubah variabel sehingga rumus dapat digunakan)
b. SUBSTITUSI TRIGONOMETRI
1. Bentuk Ö a2 - x2
misalkan x = a sin q ® q = arc sin x/a
dx = a cos q dq
ò Ö a2 - x2 dx = a ò Ö 1 - sin2q (a cos q dq)
= a2 ò cos2q dq
= ½a2 ò (1 + cos2q) dq
= ½a2 (q + sinq cosq) + c
= ½a2 ò [arc sin x + x Öa2 - x2 ] + c
a a a
ò Ö a2 - x2 dx = ½ a2 arc sin x/a + ½ x Ö a2 - x2 + c
2. Bentuk ò Öa2 + b2x2
Gunakan substitusi : x = a/b tgq
dx = a/b sec2q dq
3. Bentuk ò Öb2x2 - a2
Gunakan substitusi : x = a/b secq
dx = a/b tgq sec2q
c. PARSIIL
Yaitu mengenai integral dari suatu bentuk yang merupakan hasil perkalian antara suatu fungsi x dengan turunan dari suatu fungsi x yang lain.
I = ò f(x) g(x) dx
Misalkan : u = f(x) ; dv = g(x) dx
du = ..... dx ; v = ò g(x) dx = ..... maka :
ò u du = u v - ò v du
Pemisalan dibuat sedemikian sehingga bentuk ò v du jadi lebih mudah
Untuk hal-hal khusus dapat digunakan cara TABULASI
