1. Introduction
The concept of Ulam’s type stability was posed by Ulam, and its development is remarkable. Many researchers have studied this problem for functional equations. For an overview, see the book [
1] written by Brzdęk, Popa, Raşa, and Xu. In 1998, Alsina and Ger [
2] introduced this concept in the field of differential equations. After that, the study of Ulam’s type stability for differential equations continued to grow (see, [
3,
4,
5,
6,
7,
8,
9,
10]). Recently, Fukutaka and Onitsuka [
11,
12] dealt with Ulam’s type stability of the periodic linear differential equation
      
      on 
, where 
 is a continuous periodic function. Throughout this paper, let 
, 
. We say that (
1) has “
Ulam stability (US)” on 
I if there exists a constant 
 with the following property: Let 
 be a given arbitrary constant, and let 
 be a continuously differentiable function. If 
 holds for all 
, then there exists a solution 
 of (
1) such that 
 for all 
. We call such 
K a “
US constant” for (
1) on 
I. In 2020, Fukutaka and Onitsuka [
12] established the following theorem of Ulam’s type stability and a necessary and sufficient condition.
Theorem 1. Let  and  be antiderivatives of  and  on , respectively. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if  and , then-  ( 1- )  has US with minimum US constanton I;
 
- (ii)
- if  and , then-  ( 1- )  has US with minimum US constanton I.
 
 Remark 1. Let  and . That is, . Suppose that  is a periodic function with period  on . Then it is known that the following facts:
- (i)
- if , then  exists (see, (Lemma 3.1 [12])); 
- (ii)
- if , then  exists (see, (Lemma 3.1 [12])); 
- (iii)
-  and  are periodic functions with period  (see, (Lemma 2.3 [11])). 
 Theorem 2. Suppose that  is a periodic function with period  on . Then (
1) 
has US on  if and only if .  In recent years, Ulam stability has been actively studied not only for the first-order linear differential equations but also for the second-order linear differential equations. In 2010, Li [
13] dealt with Ulam’s type stability of the simple second-order linear differential equation
      
      where 
. This study extends to more general equations with constant coefficient. For example see the works of Li and Huang [
14], Li and Shen [
15], and Xue [
16]. On the other hand, there are many studies on the second-order linear differential equations with variable coefficients (see, [
17,
18,
19,
20,
21,
22,
23,
24]). It is well known that the most commonly encountered variable coefficient second order differential equation is Hill’s equation
      
      where 
 is a periodic function. This equation briefly describes the behavior of a large number of physical systems. For example, we can find a pendulum with moving support, electrons in a periodic potential, and beam stabilization in alternating gradient proton synchrotron (see, (Chapter 7 [
25])). However, there are no studies on the Ulam stability of the second-order linear differential equations with periodic coefficients. So, this paper focuses on the stability of differential equations with periodic coefficients. The main equation in this paper is
      
      on 
, where 
 is a continuously differentiable, periodic function with period 
. Since
      
      for all 
, 
 is also a periodic function with period 
 on 
, and thus, this equation is a member of Hill’s equations. If 
 then the above equation is reduced to the equation 
.
The main purpose of this study is to establish a necessary and sufficient condition for Ulam stability of Hill’s equations on 
. In the second section, we will establish Ulam stability of nonhomogeneous equations. In 
Section 3, we will give the main theorem and its proof. Also, a instability theorem is given. By using the obtained results, a necessary and sufficient condition is established. In 
Section 4, we will disscus the minimal US constant for the case 
. In addition, a comparison with previous results is also presented. In 
Section 5, the concept obtained in 
Section 3 is extended to nonhomogeneous Hill’s equations. As an application example, we will discuss Ulam stability of Hill’s equation whose coefficient is described by Fourier series. Finally, we will conclude that the unboundedness of the approximate solution implies the unboundedness of the exact solution.
  2. Ulam Stability for Nonhomogeneous Equations
In this section, we consider the nonhomogeneous first-order linear differential equation
      
      on 
, where 
p, 
 are continuous. We say that (
2) has “
Ulam stability (US)” on 
I if there exists a constant 
 with the following property: Let 
 be a given arbitrary constant, and let 
 be a continuously differentiable function. If 
 holds for all 
, then there exists a solution 
 of (
2) such that 
 for all 
. We say such 
K a “
US constant” for (
2) on 
I. Using the previous result Theorem 1, we find the following theorem.
Theorem 3. Let  and  be antiderivatives of  and  on , respectively. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if  and , then-  ( 2- )  has US with US constanton I;
 
- (ii)
- if  and , then-  ( 2- )  has US with US constanton I.
 
 Proof.  First, we will prove (i). Suppose that 
 and 
. Let 
 be a solution of (
2) on 
. Then we have
        
        on 
I. Using Theorem 1 with the above inequality, the periodicity of 
 and 
, we see that there exists a solution 
 of (
1) such that
        
        on 
I. Now, we consider the function 
 for all 
. Then
        
        This means that 
 is a solution of (
2) such that
        
        on 
I. The proof of (ii) is omitted because it can be proved by the same way.  □
   3. Main Results
We consider a Hill’s equation of the form
      
      on 
, where 
 is a continuously differentiable, periodic function with period 
. We say that (
3) has “
Ulam stability (US)” on 
I if there exists a constant 
 with the following property: Let 
 be a given arbitrary constant, and let 
 be a twice-continuously differentiable function. If 
 holds for all 
, then there exists a solution 
 of (
3) such that 
 for all 
. We call such 
K a “
US constant” for (
3) on 
I.
When , we can establish the following theorem.
Theorem 4. Let ,  and  be antiderivatives of ,  and  on , respectively. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if , then-  ( 3- )  has US with US constanton ;
 
- (ii)
- if , then-  ( 3- )  has US with US constanton .
 
 Proof.  Let 
. That is, 
 . Suppose that twice-continuously differentiable function 
 satisfies 
 for all 
. Define 
 on 
. Since 
 and 
 are continuously differentiable functions on 
, we see that 
 is a continuously differentiable function. In addition, we have the inequality
        
        for all 
.
First, we will prove (i). From Theorem 1 (i) with 
 and 
, and 
 on 
, there exists a solution 
 of the differential equation
        
        such that
        
        for all 
. From Theorem 3 (ii) with 
 and 
, there exists a solution 
 of the differential equation
        
        such that
        
        for all 
. Since 
 and 
 are differentiable function, 
 is also differentiable. Then we have
        
        for all 
, and therefore, 
 is a solution of (
3).
Next, we will prove (ii). From Theorem 1 (ii) with 
 and 
, and 
 on 
, there exists a solution 
 of (
4) such that
        
        for all 
. From Theorem 3 (i) with 
 and 
, there exists a solution 
 of (
5) such that
        
        for all 
. By the same calculation as (
6), we conclude that 
 is a solution of (
3) on 
. This completes the proof of Theorem 4.  □
 Remark 2. If we compare US constants in (i) and (ii), respectively, it can be seen that they have symmetry. Now we will show this fact below. For , let ,  and  be antiderivatives of ,  and  on , respectively. In (i), If  then we can find the assumption  and US constantIf  then this assumption and US constant imply that andsince ,  and , where ,  and  are real constants. That is, if  then the assumption and US constant in (i) correspond to those in (ii). Therefore, it can be concluded that the assumptions and US constants in (i) and (ii) are symmetric with each other.  Lemma 1. Let  be an antiderivative of  on . If  is a periodic function with period  on , thenholds on .  Proof.  Since 
 is continuous, and 
 is an antiderivative of 
, there exists a constant 
 such that
        
        for all 
. Using this fact, we can prove this lemma. For the reference, see (Lemma 2.1 [
12]). □
 Next, we will present an instability theorem.
Theorem 5. Suppose that  is a periodic function with period  on . If , and  or , then (
3) 
does not have Ulam stability on I.  Proof.  Set 
 be an antiderivative of 
 on 
. Using Lemma 1 and 
, we obtain
        
        This says that 
 is also a periodic function with period 
, and thus, we have
        
        For any 
, we define the function
        
        where 
 . Since this function is a solution of the equation
        
        we find 
. Now, we consider the general solution of (
3) which given by 
, where 
 and 
 are arbitrary constants. Namely, 
 means all solutions of (
3). From this, we obtain
        
        for all 
.
Now, we consider the case 
. By (
7), we have
        
        for all 
. This implies,
        
        for all 
. From this, we see that
        
        for all 
, and there exists a 
 such that
        
        for all 
. Therefore, using (
7) and (
8), we obtain
        
        for all 
, so that, 
. Hence, (
3) does not have US on 
. The proof of the case 
 is omitted as it can be proved in the same way. □
 Remark 3. Let J be an open interval satisfying . Then Ulam stability on I implies the same on J. On the other hand, instability on J implies the same on I.
 Corollary 1. Suppose that  is a periodic function with period  on . If , then (
3)
 does not have Ulam stability on .  Example 1. Consider the case  for . If , then (
3) 
does not have US on  by using Corollary 1.  Theorem 4 and Corollary 1 give the following necessary and sufficient condition.
Theorem 6. Suppose that  is a periodic function with period  on . Then (
3) 
has US on  if and only if .  Example 2. Consider the caseon , where . Then (
3) 
has US on  if and only if , by using Theorem 6.    5. Nonhomogeneous Hill’s Equations and Applications
Consider the nonhomogeneous Hill’s equation
      
      where 
 is continuous. Equation (
9) has “
Ulam stability (US)” on 
I if and only if there exists 
 such that the following holds: Let 
 be given, and let 
 be a twice-continuously differentiable function. If 
 on 
I, then there exists a solution 
 of (
9) such that 
 on 
I. 
K is called a “
US constant” for (
9) on 
I. The following result is obtained by using Theorem 4.
Theorem 8. Let ,  and  be antiderivatives of ,  and  on , respectively. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if , then-  ( 9- )  has US with US constanton ;
 
- (ii)
- if , then-  ( 9- )  has US with US constanton .
 
 Proof.  First, we will prove (i). Let 
 be a solution of (
9) on 
. Suppose that 
 and 
 on 
I. Then we have
        
        on 
I. Using Theorem 4 with the above inequality, we see that there exists a solution 
 of (
3) such that
        
        on 
I, where
        
        Let 
 for all 
. Then
        
        Thus, 
 is a solution of (
9) such that
        
        on 
I. The proof of (ii) is omitted because it can be proved by the same way. □
 Theorem 8 and Corollary 1 imply the following result.
Theorem 9. Suppose that  is a periodic function with period  on . Then (
9) 
has US on  if and only if .  US constants in Theorems 4 and 8 can be estimated as follows.
Lemma 3. Let ,  and  be antiderivatives of ,  and  on , respectively. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if  on , then 
- (ii)
- if  on , then 
 Proof.  We will prove (i). For simplicity, let
        
        and
        
        Then we have
        
        and
        
        From Remark 1, 
 and 
 are periodic functions with period 
, so that we can find 
 such that 
. Since 
 is a maximum value of 
 on 
, we see that
        
        That is, 
. From this and 
 is a periodic function with period 
 on 
, we have
        
        on 
. Let 
 satisfy 
, then we have
        
        That is, 
, and so that, we find
        
        on 
. Using (
10) and (
11), we obtain
        
The proof of (ii) is omitted because it can be proved by the same way. □
 Theorem 8 and Lemma 3 imply the following result.
Theorem 10. Suppose that  is a periodic function with period  on . Then the following hold:
- (i)
- if  on , then-  ( 9- )  has US with US constant ;
 
- (ii)
- if  on , then-  ( 9- )  has US with US constant .
 
 In many application fields, the coefficient 
 of the Hill’s equation 
 is treated as a periodic function with period 
. It is well known that 
 can be rewritten by the Fourier series of 
. That is, Hill’s equation is given by
      
      where 
, 
 and 
 are Fourier coefficients. Now, we consider the case
      
      in (
3), where 
, 
 and 
 are real-valued constants. Then we have
      
      This implies that this case corresponds to the case:
      Let 
 be a solution of (
12). Then it is an approximate solution of the nonhomogeneous Hill’s equation
      
      where 
, 
 and 
 are the same as above, and 
 is given. In fact,
      
      holds on 
. Since
      
      holds, (
13) has US on 
 if and only if 
 by Theorem 9.
Next we consider the more simple case: 
, 
. Then we have
      
      and 
 for all 
. We will show that if the approximate solution is unbounded, then there is an unbounded exact solution. Using Theorem 10, we see that there exists a solution 
 of (
13) satisfying 
 on 
, where
      
      Since
      
      is an unbounded solution of (
12), we conclude that (
13) has at least one unbounded solution.
  6. Conclusions
In this paper, we have discussed the Ulam stability of periodic linear differential equations of the first order and second order, respectively. First, we have established a sufficient condition for Ulam stability of nonhomogeneous first order equations. Next, by using this result, Ulam stability of a class of Hill’s equations is established. In particular, the exact US constant is given in the theorem. If the coefficient is a constant, it turns out to be the minimum US constant. On the other hand, the instability theorem is also given. By combining the obtained results, we have established a necessary and sufficient condition for Ulam stability of a class of Hill’s equations. Using the idea of the results obtained first, this theory is extended to nonhomogeneous Hill’s equations. Finally, we have discussed the Ulam stability of Hill’s equations where the coefficient is described by a Fourier series. By using the obtained results, it can be concluded that the unboundedness of the approximate solution affects the unboundedness of the exact solution.