The slope of the best-fit line that passes through the origin for f ( x ) = x sin x , x ∈ ( 0 , 2 π ) can be written as b π c a , where g cd ( a , b ) = 1 . Find a + b + c .
Clarification:
The best-fit line is the line such that the sum of each error squared is minimized.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We are presumably trying to minimize the following integral:
I = ∫ 0 2 π ( m x − x s i n x ) 2 d x = ∫ 0 2 π ( m 2 x 2 − 2 m s i n x + x 2 s i n 2 x ) d x
We're going to differentiate this integral with respect to m and set to zero, so any term in the integrand without an m term is irrelevant. The integral therefore becomes:
I ′ = ∫ 0 2 π ( m 2 x 2 − 2 m s i n x ) d x = 2 4 π 3 m 2 − 2 m
Differentiating and setting to zero gives:
1 2 π 3 m − 2 = 0 m = π 3 2 4
nice solution(+1) i have edited out a typo in the first line that had a square in the second integrand.
this can be solved by partial derivatives but i used projection matrices. For an unsolvable system of equations the best solution is given by A T A x = A T b where A was the original input, in this case a column vector of all numbers in ( 0 , 2 π ) . x is a scalar in this case as there is only one variable to solve in. and b is the output, in this case a sin ( a ) . written in dot product notation we have x = A . A A . b = ∫ 0 π / 2 a a d a ∫ 0 π / 2 a a sin ( a ) d a both are easy integrals to solve and we have x = π 3 2 4
Problem Loading...
Note Loading...
Set Loading...
I ( m ) = ∫ 0 2 π ( m x − x sin ( x ) ) 2 d x
I ( m ) = ∫ 0 2 π ( m 2 x 2 − 2 m sin ( x ) + x 2 sin 2 ( x ) ) d x
We're looking for the m that minimizes this integral. So:
d m d I ( m ) = 0
∫ 0 2 π ( 2 m x 2 − 2 sin ( x ) ) d x = 0
[ 3 2 m x 3 + 2 cos ( x ) ] 0 2 π = 0
1 2 m π 3 − 2 = 0
m = π 3 2 4
Thus:
a = 2 4 , b = 1 , c = 3 , a + b + c = 2 8