Problem Statement:
R π/2
Discretize the equation: f (x) = cos x + 0
sin(x + t)f (t) dt.
Step 1: Understand the Equation
The given equation is a Fredholm integral equation of the second kind, where f (x) is
defined implicitly in terms of itself. The goal is to discretize this equation, which typically
involves approximating the integral using a numerical method (like the trapezoidal rule) and
evaluating the equation at discrete points.
Step 2: Choose Discretization Points
For numerical discretization, we select N + 1 points in the interval [0, π/2].
Let these points be equally spaced:
xi = i · h, i = 0, 1, . . . , N,
π
where h = 2N
is the step size.
1
Step 3: Approximate the Integral Using the Trapezoidal Rule
R π/2
The integral 0
sin(x + t)f (t) dt can be approximated using the trapezoidal rule:
Z π/2 " N −1
#
sin(x + x0 )f (x0 ) + sin(x + xN )f (xN ) X
sin(x + t)f (t) dt ≈ h + sin(x + xj )f (xj ) .
0 2 j=1
Step 4: Discretize the Equation
Evaluate the original equation at each discretization point xi :
" N −1
#
sin(xi + x0 )f (x0 ) + sin(xi + xN )f (xN ) X
f (xi ) = cos(xi ) + h + sin(xi + xj )f (xj ) .
2 j=1
This gives a system of N + 1 equations for the N + 1 unknowns f (x0 ), f (x1 ), . . . , f (xN ).
Step 5: Write the System in Matrix Form
2
Let f = [f (x0 ), f (x1 ), . . . , f (xN )]T . The discretized system can be written as:
f = c + h (Mf ) ,
where:
c is the vector with entries ci = cos(xi ).
M is a matrix with entries: (
sin(xi +xj )
2
if j = 0 or j = N,
Mij =
sin(xi + xj ) otherwise.
Step 6: Solve the Linear System
Rearrange the equation to solve for f :
(I − hM)f = c.
This is a linear system that can be solved using numerical methods (e.g., Gaussian elimination or iterative solvers).
Final Answer:
R π/2
The discretized form of the equation f (x) = cos x + 0
sin(x + t)f (t) dt using the trapezoidal rule is:
" N −1
#
sin(xi + x0 )f (x0 ) + sin(xi + xN )f (xN ) X
f (xi ) = cos(xi ) + h + sin(xi + xj )f (xj ) ,
2 j=1
for i = 0, 1, . . . , N . This results in a linear system (I − hM)f = c, which can be solved numerically for the vector f .
Step-by-Step Construction of the System of Equations for i = 0, 1, 2, . . . , N
We start with the discretized equation at each point xi :
" N −1
#
sin(xi + x0 )f (x0 ) + sin(xi + xN )f (xN ) X
f (xi ) = cos(xi ) + h + sin(xi + xj )f (xj ) .
2 j=1
3
Let’s write this explicitly for each i:
For i = 0:
" N −1
#
sin(x0 + x0 )f (x0 ) + sin(x0 + xN )f (xN ) X
f (x0 ) = cos(x0 ) + h + sin(x0 + xj )f (xj ) .
2 j=1
Simplify: " −1
N
#
sin(2x0 )f (x0 ) + sin(x0 + xN )f (xN ) X
f (x0 ) = cos(x0 ) + h + sin(x0 + xj )f (xj ) .
2 j=1
For i = 1:
" N −1
#
sin(x1 + x0 )f (x0 ) + sin(x1 + xN )f (xN ) X
f (x1 ) = cos(x1 ) + h + sin(x1 + xj )f (xj ) .
2 j=1
For i = 2:
" N −1
#
sin(x2 + x0 )f (x0 ) + sin(x2 + xN )f (xN ) X
f (x2 ) = cos(x2 ) + h + sin(x2 + xj )f (xj ) .
2 j=1
..
.
For i = N − 1:
" N −1
#
sin(xN −1 + x0 )f (x0 ) + sin(xN −1 + xN )f (xN ) X
f (xN −1 ) = cos(xN −1 ) + h + sin(xN −1 + xj )f (xj ) .
2 j=1
For i = N :
" N −1
#
sin(xN + x0 )f (x0 ) + sin(xN + xN )f (xN ) X
f (xN ) = cos(xN ) + h + sin(xN + xj )f (xj ) .
2 j=1
4
Simplify: " N −1
#
sin(xN + x0 )f (x0 ) + sin(2xN )f (xN ) X
f (xN ) = cos(xN ) + h + sin(xN + xj )f (xj ) .
2 j=1
Matrix Representation
Let f = [f (x0 ), f (x1 ), . . . , f (xN )]T , and c = [cos(x0 ), cos(x1 ), . . . , cos(xN )]T . The system can be written as:
f = c + hMf ,
where M is an (N + 1) × (N + 1) matrix with entries:
(
sin(xi +xj )
2
if j = 0 or j = N,
Mij =
sin(xi + xj ) otherwise.
Final Linear System
Rearrange to solve for f :
(I − hM)f = c,
where I is the identity matrix. This system can be solved numerically for f .
Summary
The system of equations for i = 0, 1, . . . , N is:
" N −1
#
sin(xi + x0 )f (x0 ) + sin(xi + xN )f (xN ) X
f (xi ) = cos(xi ) + h + sin(xi + xj )f (xj ) .
2 j=1
This forms a linear system (I − hM)f = c, where M is defined as above.
5
To solve the given equation using the Leibniz rule for differentiation, follow these steps:
Given Equation:
Z x
2
f (x) = x + ex−t f (t) dt
0
Step 1: Differentiate Both Sides with Respect to x
Differentiate the entire equation with respect to x:
Z x
′ d d
x2 + x−t
f (x) = e f (t) dt
dx dx 0
Step 2: Compute the Derivative of x2
The derivative of x2 is straightforward:
d
6
x2 = 2x
dx
Step 3: Apply the Leibniz Rule to the Integral
The integral term is of the form:
Z b(x)
g(x, t) dt
a(x)
where a(x) = 0, b(x) = x, and g(x, t) = ex−t f (t).
The Leibniz rule states: Z b(x) ! Z b(x)
d ′ ′ ∂
g(x, t) dt = g(x, b(x)) · b (x) − g(x, a(x)) · a (x) + g(x, t) dt
dx a(x) a(x) ∂x
Apply this to our integral:
1. First Term: g(x, x) · b′ (x) = ex−x f (x) · 1 = f (x)
2. Second Term: g(x, 0) · a′ (x) = ex−0 f (0) · 0 = 0 (since a′ (x) = 0)
3. Integral Term:
∂
ex−t f (t) = ex−t f (t)
∂x
So, the integral becomes: Z x
ex−t f (t) dt
0
Combining these, the derivative of the integral is: Z x
f (x) + ex−t f (t) dt
0
Step 4: Combine All Terms
Now, substitute the derivatives back into the original equation:
Z x
′
f (x) = 2x + f (x) + ex−t f (t) dt
0
7
But from the original equation, we know: Z x
ex−t f (t) dt = f (x) − x2
0
Substitute this into the derivative equation:
f ′ (x) = 2x + f (x) + (f (x) − x2 )
f ′ (x) = 2x + 2f (x) − x2
Step 5: Rewrite the Differential Equation
Rearrange the terms to form a first-order linear ordinary differential equation (ODE):
f ′ (x) − 2f (x) = 2x − x2
Step 6: Solve the ODE
This is a linear ODE of the form:
f ′ (x) + P (x)f (x) = Q(x)
where P (x) = −2 and Q(x) = 2x − x2 .
The integrating factor µ(x) is: R
µ(x) = e P (x) dx
= e−2x
Multiply both sides of the ODE by µ(x):
e−2x f ′ (x) − 2e−2x f (x) = (2x − x2 )e−2x
The left side is the derivative of e−2x f (x):
d −2x
e f (x) = (2x − x2 )e−2x
dx
Integrate both sides with respect to x: Z
−2x
e f (x) = (2x − x2 )e−2x dx
8
Step 7: Compute the Integral
We need to compute: Z
(2x − x2 )e−2x dx
Use integration by parts: Let u = 2x − x2 , dv = e−2x dx, so du = (2 − 2x)dx, v = − 21 e−2x .
Apply integration by parts: Z Z
u dv = uv − v du
Z Z
2 −2x 1 2 −2x 1
(2x − x )e dx = − (2x − x )e − − e−2x (2 − 2x) dx
2 2
Z
1 1
= − (2x − x2 )e−2x + (2 − 2x)e−2x dx
2 2
Now, compute the remaining integral: Z
(2 − 2x)e−2x dx
Again, use integration by parts: Let u = 2 − 2x, dv = e−2x dx, so du = −2dx, v = − 21 e−2x .
Z Z
−2x 1 −2x 1
(2 − 2x)e dx = − (2 − 2x)e − − e−2x (−2) dx
2 2
1 1
= − (2 − 2x)e−2x − e−2x
2 2
1
= − (2 − 2x + 1)e−2x
2
1
= − (3 − 2x)e−2x
2
Substitute back: Z
2 −2x 1 2 −2x 1 1 −2x
(2x − x )e dx = − (2x − x )e + − (3 − 2x)e
2 2 2
1 1
= − (2x − x2 )e−2x − (3 − 2x)e−2x
2 4
1 1
9
−2x 2
=e − (2x − x ) − (3 − 2x)
2 4
x2 3 x
−2x
=e −x + − +
2 4 2
2
−2x x x 3
=e − −
2 2 4
Step 8: Solve for f (x)
Now, substitute the integral back:
x2 x 3
−2x −2x
e f (x) = e − − +C
2 2 4
Divide both sides by e−2x :
x2 x 3
f (x) = − − + Ce2x
2 2 4
Step 9: Determine the Constant C
Use the original equation to find C. Evaluate at x = 0:
Z 0
2
f (0) = 0 + e0−t f (t) dt = 0
0
Substitute x = 0 into the general solution:
0 0 3 3
f (0) = − − + Ce0 = − + C = 0
2 2 4 4
3
C=
4
Final Solution:
x2 x 3 3 2x
f (x) = − − + e
2 2 4 4
10
Verification:
Differentiate f (x) and substitute back into the ODE to ensure consistency.
Answer:
3 x2 x 3
f (x) = e2x + − −
4 2 2 4