Integrability Analysis of the Stretch–Twist–Fold Flow

We study the integrability of an eight-parameter family of three-dimensional spherically confined steady Stokes flows introduced by Bajer and Moffatt. This volume-preserving flow was constructed to model the stretch–twist–fold mechanism of the fast dynamo magnetohydrodynamical model. In particular we obtain a complete classification of cases when the system admits an additional Darboux polynomial of degree one. All but one such case are integrable, and first integrals are presented in the paper. The case when the system admits an additional Darboux polynomial of degree one but is not evidently integrable is investigated by methods of differential Galois theory. It is proved that the four-parameter family contained in this case is not integrable in the Jacobi sense, i.e. it does not admit a meromorphic first integral. Moreover, we investigate the integrability of other four-parameter $${\textit{STF}}$$STF systems using the same methods. We distinguish all the cases when the system satisfies necessary conditions for integrability obtained from an analysis of the differential Galois group of variational equations.


Origin of STF Systems
One of the important problems of geo-and astrophysics is an explanation of the origin of magnetic fields of stars and planets. The dynamo model provides a widely accepted explanation. Let us consider the liquid iron in the outer core of the Earth or an ionized gas in a star. An external magnetic field operates on the particles of electrically conducting liquid flowing with velocity u by the electromotive force u× B which generates a current. But according to Ampère's law, whenever a current flows, a magnetic field is generated. Conditions under which an induced magnetic field and an inducing field are the same are especially interesting, and are studied in the dynamo theory, where we say that a dynamo is self-excited and produces a magnetic field in a continuous way. To describe these complex phenomena, we use equations of magnetohydrodynamics, see e.g. Childress and Gilbert (1995) or Childress (1992). However, in this kinematic approach to the dynamo theory, we assume that a velocity field u is known. Its properties are crucial when one wants to explain how a flowing conductive liquid can generate the magnetic field, because the magnetic field is frozen into this fluid.
In the case of the so-called fast dynamo, a heuristic explanation of the mechanism was proposed by Vainshtein and Zeldovich (1972). The growth of the magnetic field is generated by an iterated sequence of three processes, i.e. stretch, twist and fold (STF), acting on the flux tube created by a small bundle of lines of the magnetic field. On the basis of this explanation, scientists started to construct dynamical systems called STF systems describing a steady-state velocity field u(x) which mimics these three processes and is subject to certain constraints. We usually assume that u(x) should satisfy the incompressibility condition ∇ · u = 0, and the boundedness of flows to unity sphere x · x = 1 with the boundary condition x · u = 0. The streamlines in the first STF model proposed in Moffatt and Proctor (1985) were unbounded, which was an undesirable property of the system. The authors tried to correct this defect by multiplying the vector potential of the obtained velocity field u(x) by the exponential term e −r /R that forces the streamlines to return to the interior of the sphere with radius r = √ x · x = R. Results of numerical simulations of dynamics of this type modified the velocity field; in particular, its multi-fractal properties were investigated in Vainshtein et al. (1996b).
A more elegant remedy was proposed in Bajer (1989) and Bajer and Moffatt (1990). The authors extended the velocity field considered in Moffatt and Proctor (1985), adding to it the appropriate additional potential field such that the two required conditions were satisfied. As a result, they obtained the following differential systeṁ (1.1) The properties of the system (1.1) were investigated in manys articles. The condition of incompressibility ∇ · u = 0 means that the system preserves the volume in its phase space and is manifested by the absence of strange attractors. However, such systems can still exhibit a rich variety of structures with chaotic and regular orbits intricately interspersed among one another, see e.g. Chapter 7 in Lakshmanan and Rajasekar (2003). Bajer and Moffatt (1990) observed that for α = β = 0, the system (1.1) is integrable with first integrals I 1 = x 1 x 4 3 and I 2 = x −3 3 (x 2 1 + x 2 2 + x 2 3 − 1), and it is chaotic for small values of α. Lyapunov exponents and the power spectrum of (1.1) were analysed by Aqeel and Yue (2013). Additionally, Yue and Aqeel (2013) detected Smale's horseshoe chaos using the Shil'nikov criterion for the existence of a heteroclinic trajectory. Vainshtein et al. (1996a) considered the system (1.1) with β = 0 and with small values of α as a small perturbation of the integrable system corresponding to α = 0.
Let u 0 (x) denote the vector field given by the right-hand sides of (1.1). It has zero divergence and can be considered as a velocity field of an incompressible fluid. Moreover, the unit ball is invariant with respect to its flow, and the vector field u 0 (x) is tangent to the boundary ∂ B 3 , which is the unit sphere S 2 . In fact, polynomial F 0 = x 2 1 + x 2 2 + x 2 3 − 1 is a Darboux polynomial of u 0 (x), as it satisfies the equality where L v denotes the Lie derivative along vector field v. Thus, sphere S 2 which coincides with level set F 0 (x) = 0 is also invariant with respect to the flow generated by u 0 (x). Hence, considering u 0 (x) as the velocity of a fluid, the system (1.1) describes a steady flow inside a unit ball. As was pointed out by Bajer and Moffatt (1990), this is the first example of a steady Stokes flow in a bounded region exhibiting chaos. The fact that the system (1.1) is chaotic for generic values of parameters is clearly visible on the Poincaré cross-sections in Fig. 1 containing large chaotic regions. The system (1.1) is contained in a wider multi-parameter family of threedimensional quadratic systems satisfying incompressibility and boundedness conditions proposed in Bajer and Moffatt (1990), of the forṁ where a, ω ∈ R 3 are constant vectors and J is a symmetric matrix. We also call it the STF system. The vector field u(x) defined by the right-hand side of (1.3) satisfies for arbitrary values of parameters a, ω and J. Thus, it is a divergence-free vector field, and the unit ball B 3 and the unit sphere S 2 are invariant with respect to its flow. In fact, this is the most general polynomial vector field of degree two having these two properties. It is also worth mentioning that some experimental realizations of the STF flows have been conducted, see e.g. Fountain et al. (1998Fountain et al. ( , 2000.

The Canonical Form of STF System
In this subsection we rewrite the considered system (1.3) in an equivalent form that is useful for further analysis. Let A ∈ SO(3, R) be a rotation matrix and let x → y = Ax be the corresponding change of variables. Then the transformed vector field u( y) = Au( A T y) has the form Hence, we introduce new parameters m 1 = J 2 − J 3 , m 2 = J 3 − J 1 and m 3 = J 1 − J 2 = − m 1 − m 2 . Using these, we can write J in the form (1.8) Thus, system (1.3) can be written aṡ . In further analysis we will use this form of the STF flow which depends on eight parameters: components of vectors a, ω, and m 1 , m 2 . Let us also note that this system is invariant with respect to simultaneous cyclic permutations of variables (

Main Problem
Let us note that investigations of the system (1.1), which is a two-parameter family of general S F T system (1.3), were performed in two directions. Apart from the results showing that for generic values of parameters (α, β) ∈ R 2 the system (1.1) is chaotic, investigations of integrability have been carried out. Bao and Yang (2014) proved that if α = 0, then the system (1.1) does not admit a Darboux first integral. Nishiyama (2014a) proved that if α ∈ R + \Λ, where Λ = 24 √ 65 , 4 6 5 , 4 21 17 , and β = 1, or α = 1, β ∈ R + \{2 √ 23, 8 √ 5, 16 √ 2}, the system has no real meromorphic first integral. Later, Nishiyama (2014b) showed that the system does not admit a meromorphic first integral for an arbitrary α > 0 and β = 1. These non-integrability results were obtained by means of the Ziglin theory combined with differential Galois theory. Yagasaki and Yamanaka (2017) formulated necessary conditions for the integrability of systems with orbits which are homo-or heteroclinic to unstable equilibria. Using these, they proved that if the system (1.1) admits a real meromorphic first integral, then On the other hand, the strongest results describing chaotic behaviour of the system (1.1) were obtained by Neishtadt et al. (1999Neishtadt et al. ( , 2003 by considering small perturbations of integrable case when α = 0. The mechanism of destruction of an adiabatic invariant caused by the separatrix crossings, scatterings and captures by resonances results in mixing and transport in large parts of the phase space. Although the dynamics of the system are close to hyperbolic, the system is not ergodic, as one can find stable periodic orbits surrounded by stability islands.
In order to perform investigations of the general STF flow (1.3) using methods similar to those of Neishtadt et al. (1999Neishtadt et al. ( , 2003, we must identify the parameter values for which the system is integrable. For example, we found that if a = 0, then the system (1.3) simplifies tȯ and it is integrable with two quadratic first integrals (1.15) Let us note that system (1.14) coincides with the Zhukovski-Volterra gyrostat (Basak 2009). Thus, for small values of a, one can consider the STF system as a perturbation of an integrable Zhukovski-Volterra gyrostat. This enables the possibility to investigate chaotic behaviour for small values of a , and it seems that this fact has not been explored until now.
The aim of this paper is to study the integrability of the general STF flow (1.3). More precisely, our goal is to distinguish the parameter values for which the dynamics is regular and the considered system is integrable. However, all known methods for studying integrability give only the necessary conditions for integrability. Thus, it is better to say that our main goal is to distinguish parameter values for which the system is not integrable. Nevertheless, considering a specific family of STF systems, we found the necessary and sufficient conditions for its integrability.
To the best of our knowledge, apart from a preliminary analysis in Bajer and Moffatt (1990), the integrability of (1.3) has not yet been investigated. Thus, our main goal is to initiate such an investigation. Here we underline again that the formulated problem is very hard because the system depends on many parameters. Our attempt is to distinguish as many cases as possible for which investigation of the integrability can be performed effectively.
For analysis of the integrability, we use the differential Galois framework. Here, two facts are important. In the context of this paper, integrability means integrability in the Jacobi sense. Thus, we do not use the criteria for integrability of non-Hamiltonian systems developed by Ayoul and Zung (2010). In fact, we know only one article when differential Galois methods were specifically used to investigate integrability in the Jacobi sense (Przybylska 2008). Moreover, in this paper we propose to combine differential Galois tools with the Darboux method for studying integrability. This idea is general in the sense that it can be applied to studying the integrability of an arbitrary polynomial system. That is, to apply the differential Galois methods, we need a particular solution of the considered system. To find it we perform a direct search for Darboux polynomials. Then we restrict the search for a particular solution to the common zero level of Darboux polynomials. In the case of the STF system, we already have one Darboux polynomial F 0 = x 2 1 + x 2 2 + x 2 3 − 1. Hence, if F 1 is an additional Darboux polynomial, then their common level if non-empty, is a union of phase curves of the system. An analysis of variational equations along selected phase curves gives obstructions for the integrability. These are expressed in terms of properties of the differential Galois group of the variational equations.
In the general case, when the system admits several Darboux polynomials, we can try to find a first integral using the Darboux method.
Simply trying to perform the action described above for the STF flow, we quickly face serious difficulties. Again, because of the large number of parameters, the direct search for Darboux polynomials, even with a help of computer algebra systems, must be restricted to polynomials of low degree. Moreover, it appeared that the existence of just one additional Darboux polynomial almost always gives rise to a first integral of the system. This is why we restricted our search to Darboux polynomials of first degree, and we found all the cases when the STF system admits such a polynomial. The proof of this fact is purely analytic.
Thanks to the above result, we have found cases dependent on six parameters for which the differential Galois methods can be used, i.e. we know a particular solution of the system. However, an investigation of this case with all admissible parameters leads to intractable complexities. This is why we restrict our study to some cases with certain restrictions on parameters.
The first involves the determination of cases when the general STF system (1.9) admits a linear Darboux polynomial. Although this was a preliminary step in our investigations, it unexpectedly gave, among other things, quite a large list of integrable cases.
The second part of our results contains theorems which give necessary or necessary and sufficient conditions for the integrability of distinguished families of the STF system obtained by an application of the differential Galois methods.

STF System with Linear Darboux Polynomials
Finding all Darboux polynomials of a given system is difficult because we do not know the upper bound for the degree of this polynomial. Moreover, even if we fix the degree of the Darboux polynomial we search for, the problem is difficult because it reduces to a system of non-linear polynomial equations. The difficulty grows significantly when the systems considered depend on parameters.
As we mentioned above, the general STF system (1.9) has Darboux polynomial F 0 (x), and the problem is to find all values of parameters for which other Darboux polynomials exist. Even if we limit ourselves to linear Darboux polynomials, finding all of them for a multi-parameter STF system is not trivial. In fact, we have to find all solutions of a system of 10 quadratic polynomial equations dependent on 16 variables.
The results of the search for an additional linear Darboux polynomial in variables can be summarized in the following theorem.
Theorem 2.1 The STF system (1.9) has a Darboux polynomial of degree one only in the cases listed below and in conjugated cases obtained by a cyclic permutation of the parameters and variables.

2)
where ε 2 = 1. Case IIa: If m 1 a 2 2 = m 2 a 2 1 , a · ω = ω 3 m 1 a 2 a 1 , a 1 = 0, and m 2 1 + m 2 2 = 0 and a 2 1 + a 2 2 = 0, then there is one Darboux polynomial Case IIb: If a 1 = a 2 = 0, ω 3 = 0 and m 2 1 + m 2 2 = 0, then (2.4) In this case, if additionally a 3 + ε √ m 1 m 2 = 0, then it must be −m 1 ω 1 + ε √ m 1 m 2 ω 2 = 0 and is a first integral of the system. Case IIc: If a 1 = a 2 = 0, ω 1 = ω 2 = 0 and m 2 = − m 1 and ω 3 = 0, then the two polynomials are Darboux polynomials. Case III: If a 1 = m 1 = 0 and ω = (ω 1 , −αa 3 , αa 2 ), then there is one Darboux polynomial (2.6) All of the above cases except Case IIa are integrable. Since the STF flow preserves a volume in the phase space for the integrability, just one first integral is necessary; see explanations about the integrability in the Jacobi sense at the beginning of Sect. 3. Knowing Darboux polynomials, one can effectively construct first integrals using properties of Darboux polynomials recapitulated in Proposition 3.1. In particular, when cofactors are linearly dependent over Z, a rational first integral can be built. The STF system reduced to a fixed level of a first integral has an integrating factor (3.3) that enables us to find the second first integral using formula (3.4). This procedure is called the last Jacobi multiplier method and is briefly described in Sect. 3. Finding an explicit form of this first integral, however, can be difficult.
In Case Ia, polynomials of degree four F 0 F 2 i , or rational functions F i /F j , where F i are given in (2.1), are first integrals, and one can choose two that are functionally independent e.g. (2.7) In Case Ib, since the Darboux polynomial F + 1 F − 1 has the cofactor 2a · x (see Eq. (2.2)), I 1 = F + 1 F − 1 F 0 is a first integral that after division by constant a 2 1 + a 2 2 takes the final form In Case IIa, as well as in the conjugated cases obtained by a cyclic permutation of the parameters, the integrability of the system is an open question.
In Cases IIb and IIc, it holds that a 1 = a 2 = 0, and the Darboux polynomial F 0 has the cofactor P 0 = − 2a 3 x 3 . Thus, the Darboux polynomial F 1 = F + 1 F − 1 has the cofactor P 1 = 2a 3 x 3 , and the product I 1 = F 0 F 1 is a polynomial first integral of the system. In Case IIb, first integral I 1 = F 0 F 1 takes the form (2.8) Moreover, one can construct the second first integral I 2 which is functionally independent of I 1 and is of the Darboux type where F ± 1 are given in (2.4). In the special subcase of Case IIb, the second first integral built by means of the last Jacobi multiplier and functionally independent of (2.5) is (2.10) In Case IIc, the explicit form of the first integral I 1 = F 0 F 1 is The second first integral can be constructed by means of the last Jacobi multiplier as where I 1 is given in (2.11). The integral in the last term defines an elliptic integral, see Section 230 in Byrd and Friedman (1971).
. We can find the second first integral just by applying the Jacobi last multiplier method. However, it is instructive to note that in the considered case, the system admits an exponential factor H of the form is a first integral of the system.

Integrability of Distinguished Families of the STF System
In Case IIa given in the previous section, the STF system depends on six parameters.
if not empty, a small circle on the sphere. It is just a phase curve we look for in order to apply the differential Galois methods to study integrability. In general, the sphere F 0 (x) = 0 and plane F 1 (x) = 0 have a non-empty intersection in C 3 which gives us a phase curve of the complexified STF system. Hence, our idea concerning finding a particular solution of the system was successfully applied. In fact, it gave us more than we expected. When trying to apply the differential Galois techniques for the Case IIa family, we encountered serious problems. When working with a seven-parameter family, we did not find a good way to cope with the complexity of calculation. Moreover, the difficulties were of a fundamental nature. In the best case, using the differential Galois method, we can obtain necessary conditions for integrability that depend on five or four parameters. In fact, these conditions are not usable. This is why we decided to consider a family of the STF system in Case IIa with the additional assumption ω = 0. We obtained the necessary and sufficient integrability conditions formulated in this theorem.
The first integrals in the four cases mentioned in the above theorem are constructed using Darboux polynomials and using the last Jacobi multiplier method.
• If a 1 = a 2 = 0, then we are in Case IIb. Formulae for the two additional Darboux polynomials (2.4) simplify to and for the first integral (2.8) to The second first integral built by means of the last Jacobi multiplier and after taking the exponent becomes One can simplify it using the formula arctanh x = 1 2 ln x+1 1−x to the form • If m 1 = m 2 = 0, then we are in Case Ia with additional Darboux polynomials (2.1) and two functionally independent first integrals (2.7). • If a 1 = m 1 = 0, we are in Case III, where an additional Darboux polynomial given in (2.6) simplifies to F 1 = x 1 with the cofactor P 1 = a 2 x 2 + a 3 x 3 . The corresponding first integral is The second first integral built by means of the last Jacobi multiplier is where | · | denotes the absolute value. • If a 2 = m 2 = 0, an additional Darboux polynomial is F 1 = x 2 with the cofactor P 1 = a 1 x 1 + a 3 x 3 . The corresponding first integral is and the second first integral built by means of the last Jacobi multiplier takes the form This case can be obtained from the previous one by the change of variables Let us note that in all integrable cases, the first integral I 1 is polynomial and global, but the second first integral obtained from the last Jacobi multiplier method is not meromorphic. The dynamics of divergence-free three-dimensional systems with one global first integral is described in Section 3 of (Lerman and Yakovlev 2019). Phase space of such systems is foliated by means of levels of its global first integral. In the case when a global first integral has only a finite number of critical levels, its noncritical levels are always a 2-torus, but the linearization of the flow on these tori is not always possible.
The second analysed family of STF systems can be considered as a direct generalization of the system (1.1). That is, we consider the system (1.9) with the following parameters We denote the corresponding vector field by u g (x). According to Remark 1.1, for the system (1.1) we have m 1 m 2 = 25, ω 3 = α and a 3 = − 3. Thus, u g (x) is a two-parameter generalization of the system (1.1).
To describe the obtained results, we introduce the following parameters ( 2.16) With these parameters, and after rescaling of time t → a 3 t, the explicit form of the system corresponding to u g (x) readṡ We divide the whole range of parameters (μ 1 , μ 2 ) into disjoint sets as shown in Figs. 2 and 3. Our investigation of the integrability of the system (2.17) is performed separately in each of these regions. Let us first note that in the case μ 3 = 0, i.e. where μ 2 = − μ 1 , the system (2.17) is integrable with the first integral Thus, in our further analysis, we exclude cases where μ 2 = − μ 1 . The results of our analysis are split into five theorems. To formulate the first of these, we define the hyperbolas and (2.20) for an integer m, or for an integer m.
In the cases specified in Theorem 2.4, Poincaré cross-sections do not give a clear suggestion concerning the integrability, see Fig. 5a, and its magnification around an Example of a Poincaré cross-section for the system (2.17) with (μ 1 , μ 2 ) = 1 2 , 1 2 ∈ C and ω = 2 satisfying μω = 1; cross-plane y = 0 unstable periodic solution in Fig. 5b. Calculations were carried out for the system (2.17) with parameters μ 1 = μ 2 = μ = 1 2 and ω = 2 satisfying μω = 1 ∈ Z. Actually, when we compare these Poincaré cross-sections with Fig. 6a and with its magnification in Fig. 6b obtained for the system (2.17) with parameters μ 1 = μ 2 = μ = 2 3 and ω = 3 2 3 2 , we do not see a large difference in the regularity of the trajectories, although in this case μω = 3 2 / ∈ Z. The global Poincaré cross-sections shown in Figs. 5a and 6a have very regular structures built by means of quasi-periodic orbits. But the fact that we do not see chaos in the global scale does not mean that the system is regular. We can expect that in the neighbourhood of an unstable periodic orbit chaotic zones exist, but magnifications in Figs. 5b and 6b do not show them.

Tools and Methods
Let us make the notion of integrability precise in the context of this paper. Since the system is divergence-free, it is natural to use integrability in the Jacobi sense.
A system integrable in the Jacobi sense is integrable by quadratures. In fact, taking the first integrals f 1 (x), . . . , f (n−2) (x) as new variables, we can assume that the transformation is invertible, at least locally. In new variables, the system reduces to two equationṡ with right-hand sides dependent on (n −2) parameters. System (3.2) has an integrating factor μ(y 1 , is the remaining first integral, which allows us to determine phase curves of the system, and with one more quadrature allows us to determine the time evolution along them. Let us recall basic definitions and facts concerning Darboux polynomials. We denote by C[x] = C[x 1 , . . . , x n ] the ring of complex polynomials of n variable x, and by C(x) the field of rational functions. Let v(x) = (v 1 (x), . . . , v n (x)) ∈ C[x] n be a polynomial vector field and let L v be the corresponding Lie derivative.
, which is called the cofactor of F. We collect basic properties of Darboux polynomials in the following proposition.
then their product F = F 1 · · · F k is a Darboux polynomial with a cofactor P = P 1 + · · · + P k , i.e. L v F = P F. 2. If F is a Darboux polynomial, then its irreducible factors are also Darboux polynomials. 3. If F 1 , . . . , F k are Darboux polynomials and their cofactors satisfy for certain numbers α 1 , . . . , α k ∈ C, then F = F α 1 1 · · · F α k k is a first integral of v(x). 4. If F 1 , . . . , F k are Darboux polynomials with the same cofactor P, then an arbitrary linear combination is a Darboux polynomial with the cofactor P.
A very nice and concise exposition of this subject can be found in Nowicki (1994).
To prove non-integrability of the STF system, we need strong necessary integrability conditions that can be effectively applied. We use obstructions formulated by means of the properties of the differential Galois group of variational equations obtained from the linearization of the STF system along certain known particular solutions. For a detailed exposition of the differential Galois theory, see e.g. Kaplansky (1976) and Morales Ruiz (1999). To find a necessary particular solution, an additional Darboux polynomial or a manifold invariant with respect to the STF flow can be useful. We will apply the following theorem, which follows from Corollary 3.7 in Casale (2009).

Theorem 3.1 Assume that a complex meromorphic systemẋ = v(x), x ∈ C n is integrable in the Jacobi sense with meromorphic first integrals and with a meromorphic invariant n-form. Then the identity component of the differential Galois group of variational equations along a particular phase curve is solvable. Moreover, the identity component of the normal variational equations is Abelian.
Our paper is the first application of this general criterion for the integrability in the Jacobi sense. The applicability of this theorem is dependent on the knowledge of a particular solution and the possibility of determining the differential Galois group of variational equations along this particular solution.
For the investigated system, we found particular solutions, so the problem is to determine the differential Galois group of variational equations. Here we underline that for a parameterized system, this problem is very hard and, in fact, is unsolvable, see Theorem 1 in Boucher (2000).
The crucial step in our investigation is the proper reduction of the variational equation to the second-order equation of second-order and rational coefficients. There is a canonical recipe for how to perform this. The fact that we succeeded in reducing the variational equations to the Riemann P equation gave us the possibility of proving our main theorem. It was equally important to find necessary and sufficient conditions for which the differential Galois group of the Riemann P equation has an Abelian identity component, as the well-known Kimura theorem only gives the necessary and sufficient conditions for solvability of this group.

Proof of Theorem 2.1
Preliminary analysis Let F be a Darboux polynomial linear in variables and let P be its cofactor. We can write them in the form and we can assume that f = 0. The polynomial R = L u F − P F has degree two. Its homogeneous terms R i of degree i are as follows As, by assumption, R(x) vanishes identically, all its coefficients vanish so that we obtain the following system of polynomial equations: and [·, ·] denotes the commutator of matrices. Hence, we have a system of 10 polynomial equations for 15 variables. Taking into account two independent rescalings, we can reduce the number of variables to 13. Equation (4.3c) can be rewritten in the form where (i, j, k) is a cyclic permutation of (1, 2, 3). The starting point of our analysis is two equations R 1 ( f ) = 0 and R 2 ( f ) = 0. Their explicit forms are Note also that from (4.5) we get − p). Proof There are two cases.
In this way we have proved that f · a = 0, and f · p = 0.
From Eq. (4.3b), with f 0 = 0, we have We recapitulate the above considerations in the following. and where (i, j, k) is a cyclic permutation of (1, 2, 3).
We split our further analysis into three disjoint cases corresponding to the number of non-vanishing components of vector f = ( f 1 , f 2 , f 3 ). We assume that a = 0, a, ω ∈ R 3 , and m 1 , m 2 ∈ R. Under these assumptions, our analysis is complete. Case I: Let us assume that f i = 0 for i = 1, 2, 3. Then, Eq. (4.12) imply that p = a, and in turn, from Eq. (4.15) we obtain m 1 = m 2 = m 3 = 0.
If f · f = 0, then by Proposition 4.1 p · ω = a · ω = 0 and p 0 = 0. Therefore, in this case we take an arbitrary f = 0 such that f · a = 0, and then Eqs. (4.15), (4.12) and (4.13) are fulfilled. It remains to solve Eq. (4.14) for f 0 . By taking the scalar product of both sides (4.14) with a, we obtain To summarize, if f · f = 0 and f · a = 0, then F = f 0 + f · x with f 0 given above is a Darboux polynomial of (1.3), and P = a · x is its cofactor. Note that the cofactor does not depend on a choice of f . Thus, we have a family of Darboux polynomials parameterized by a complex vector f which is orthogonal to vector a. As all these Darboux polynomials have the same cofactor, they form a two-dimensional complex linear space, see point 4 in Proposition 3.1. Each element of this vector space can be written as a linear combination of the following three polynomials Compare this with formula (2.1). Assume now that p 0 = 0; then by Proposition 4.1 we have f 0 = 0 and f · f = 0. It is easy to show that f · f = 0 if and only if f = b + ic, with b, c ∈ R 3 such that b · b = c · c and b · c = 0. As f · a = 0, we have a · b = 0 and a · c = 0. Thus, a real vector perpendicular to b and c is parallel to a. Hence, because f · ω = 0, we have ω = λa for a certain λ ∈ R. It remains to determine p 0 . When multiplying Eq. (4.3b) by b, we obtain iλa · (b × c) = p 0 b · b. (4.18) To summarize, if f · f = 0 and f · a = 0, then F = f · x is a Darboux polynomial of (1.3), and P = p 0 + a · x with p 0 defined above is its cofactor. In fact, the above formulae define a family of Darboux polynomials for the given parameters of the system. To show this we assume that for a given a and ω = λa, satisfies f (s) · f (s) = 0 and a · f (s) = 0 for all s ∈ R. Moreover (4.20) Hence, for arbitrary s ∈ R, F(s) = f (s) · x is a Darboux polynomial of the system and P = p 0 + a · x is its cofactor.
To give explicit forms of vectors b and c, we assume that a 1 = 0. Then, we can set and p 0 = iλ a . Substituting these formulas into (4.19) gives F(s) = f (s) · x = e −is a F + 1 , where F + 1 is given in (2.2). Since F + 1 is a complex Darboux polynomial, its complex conjugation is also a Darboux polynomial F − 1 = F + 1 with the cofactor P − 1 = P + 1 . Case II: Here we assume that two components of f are different from zero. Let f 1 f 2 = 0 and let f 3 = 0. Then, by (4.12) we get p 1 = a 1 and p 2 = a 2 . Equations (4.15) reduce to the following system (4.22) As a homogeneous system for ( f 1 , f 2 ) it has a non-zero solution if (4.23) We can assume that m 1 m 2 = 0. In fact, if m 1 = 0, then p 3 = a 3 and m 2 = 0, so this is the case considered in the previous subsection. We split our further analysis into two parts with results collected in two lemmas.
Collecting the results obtained for all the above cases gives the statement of Theorem 2.1.

Proof of Theorem 2.2
Proof In the previous section we showed that if the STF system possesses a linear Darboux polynomial, then it is integrable, with the exception of the families distin-guished in Lemma 4.1. These families depend generically on six real parameters, and there is no reasonable way to effectively and completely investigate their integrability. This is why we decided to investigate certain subfamilies which depend on a smaller number of parameters. Thus, in Theorem 2.2, we consider the STF system satisfying the two conditions ω = 0 and a 2 1 m 2 = a 2 2 m 1 . Taking into account the thesis of Theorem 2.2, we can assume that a 1 a 2 = 0 and m 1 m 2 = 0.
With the specified restrictions on parameters, the STF system possesses one additional Darboux polynomial F 1 with the corresponding cofactor P 1 given by We first set a 1 = a sin α and a 2 = a cos α, a = a 2 1 + a 2 2 . Next, we rotate coordinates x = A y in such a way that the Darboux polynomial F 1 becomes a new coordinate ⎡ (4.42) The transformed system readṡ y 2 = − γ y 1 y 3 − a − 1 + 2y 2 1 + y 2 2 − sy 2 y 3 + 2y 2 3 , y 3 = γ y 1 y 2 + a s(y 2 1 − y 2 2 ) + y 2 y 3 − c − 1 + 3y 2 1 + y 2 2 + y 2 3 , (4.43) where parameters c and s are defined by a 3 = ac, a 3 + m 1 cot α = as, and A particular solution is given by the intersection of the sphere F 0 = y 2 1 + y 2 2 + y 2 3 − 1 = 0 with the plane F 1 = y 1 = 0, so it is the great circle y 2 2 + y 2 3 = 1. We parameterize it in the following way where function x(t) satisfies the differential equatioṅ The variational equations for this particular solution have the form The explicit form of entries b i1 is irrelevant for our further considerations. The equation for Y 1 separates from the other equations. Thus, we can assume that Y 1 = 0, and then equations for Y 2 and Y 3 form a closed system called a normal variational system. If we choose as a dependent variable, and as an independent variable, then we obtain the second-order differential equation with rational coefficients (4.47) The reduced form of this equation is obtained by means of the transformation (4.49) The coefficient r (z) in (4.48) has the form (4.51) Equation (4.48) has three regular singular points at z = 0, z = 1 and z = ∞, so it is a Riemann P equation. To prove non-integrability of the STF system by Theorem 3.1, we must show that the identity component of the differential Galois group of Eq. (4.48) is not Abelian. The facts concerning the differential Galois group of a general Riemann P equation are collected in "Appendix B" section.
In the above notation, ρ, σ and τ are the differences of exponents at singular points. From (4.51) we have ρ −σ +τ = 1, so by Lemma B.1, the equation and its differential Galois are reducible. Next, by Lemma B.4, if the identity component of the differential Galois group is Abelian, then either all the exponents are rational or the difference of the exponents at one point is an integer, and this singularity is not logarithmic.
Let us check the first possibility. Conditions ρ, σ ∈ Q imply that c = s. Recall that c = a 3 a , and s = b a = a 3 a + a 2 m 1 a 1 a . Thus, we obtain condition a 2 m 1 = 0. However, the assumptions of the theorem exclude this case.
As ρ and τ are not real numbers, for the second possibility we have only one choice, namely, that the difference of exponents σ at z = 1 is an integer.
Note that none of these sums belongs to the set n defined as This means that the singularity z = 1 is logarithmic.
To summarize, the identity component of the differential Galois group of the variational equation is solvable, but not Abelian. Hence, the system is not integrable; this finishes our proof.
The system (4.52) has a particular phase curve defined by (4.53) The variational equations for this curve have the form (4.54) Only a subsystem for two first variables is relevant for further consideration.
This is a normal variational system. It can be rewritten as a second-order equation, although this procedure is not unique. To find an optimal reduction, we can derive the second-order differential equation for variable Z = c 1 X 1 + c 2 X 2 with arbitrary constant coefficients c 1 and c 2 . We achieve this by the elimination of X 1 and X 2 from the equations (4.56) The obtained equationZ + a(t)Ż + b(t)Z = 0 (4.57) has complicated coefficients. For further analysis, it is crucial to choose coefficients c in such a way that the obtained equation has the simplest form. For the problem considered here, a generic choice of coefficients c = [c 1 , c 2 ] T leads to an equation with four regular singular points. However, we note that for all the values of the problem parameters except the case μ 2 = − μ 1 , we can reduce the system to an equation with three regular singular points, i.e. to the Riemann P equation. To achieve this, we choose the independent variable z := 1 2 (x 3 (t) + 1) (4.58) and set as a dependent variable, where Here, we assume that ω = 0. Then, w(z) satisfies the equation where ρ 2 = ω 2 (μ 1 + 1)(μ 2 − 1), σ 2 = ω 2 (μ 1 − 1)(μ 2 + 1), (4.61) This is the Riemann P equation; see "Appendix B" section. The differential Galois group of this equation is denoted by G, and its identity component by G • . The differences of exponents ρ and σ are real or imaginary, depending on the values taken by μ 1 and μ 2 , and the analysis of G • splits into parts related to particular regions of (μ 1 , μ 2 )-plane. We first consider the case when parameters belong to the region A defined by the following three inequalities see Fig. 2.
Assume that (μ 1 , μ 2 ) ∈ A\{(0, 0)}, and that the group G • is Abelian. Then, by the Kimura Theorem B.1, either this group is reducible (case A of this theorem), or the differences of exponents (ρ, σ, τ ) belong to an item of the table given for case B.
We show that case B does not occur for the considered domain of the parameters. It is impossible that ρ, σ, τ ∈ R. In fact, if ρ, σ ∈ R, then ρ = σ = 0, and this is possible only for (μ 1 , μ 2 ) = (1, − 1) or (μ 1 , μ 2 ) = (− 1, 1), but for these two values τ = 1 − iω / ∈ R. In this way we have excluded items 2 − 15 in the table of case B. If (ρ, σ, τ ) belong to the first item in this table, any two of these numbers belong to 1 2 + Z. Thus, either ρ ∈ 1 2 + Z or σ ∈ 1 2 + Z. However, this is impossible. Thus, if G • is Abelian, then it is reducible (case A of the Kimura theorem). By Lemma B.4, it is possible in only two cases. Either ρ, τ and σ are rational, but we have already shown that this is impossible, or one of these numbers is an integer and the corresponding singularity is not logarithmic. The case ρ ∈ Z implies that ρ = 0 and the singularity z = 0 is logarithmic. Similarly, if σ ∈ Z, then σ = 0 and the singularity z = 1 is logarithmic.
Moreover, if μ 1 μ 2 = 0, then τ / ∈ R. Let us assume that the group G • is Abelian. Then, we proceed as in the previous lemma. We first show that case B of the Kimura theorem is impossible. In fact, because ρ / ∈ R, only the first item in the table of case B is possible. Therefore, σ ∈ 1 2 + Z, τ ∈ 1 2 + Z, but the last condition is impossible. Thus, if G • is Abelian, then Eq. (4.60) is reducible. From the condition (B.7) for this case we deduce that ρ = ± im τ . By squaring this equality, we obtain (μ 1 + 1)(μ 2 − 1) = 4μ 1 μ 2 . (4.67) This is exactly the hyperbola H defined by (4.65) and one of its components denoted by H − lies in region B.
Let us consider region B on the (μ 1 , μ 2 ) defined by see Fig. 2. We also define curve H given by the equation where m is a non-zero integer.
The proof of this lemma is similar to the previous one, so we leave it to the reader. Now, proof of Theorem 2.3 follows directly from Lemmas 4.3-4.5.
Proof If (μ 1 , μ 2 ) ∈ C, then ρ, σ ∈ iR and τ ∈ R. Assume that the group G • is Abelian. Then, the Kimura Theorem B.1 gives two possibilities. As in the previous proofs, we first exclude case B of this theorem. If ρ ∈ R, then ρ = 0, and, similarly, if σ ∈ R, then σ = 0, and this eliminates all the items in the table for case B. In fact, for case B at least two of the numbers ρ, σ and τ are non-zero real numbers.
The proof of this lemma is similar to the proof of the previous one, and so we omit it. This lemma proves Theorem 2.6.
We prove Theorem 2.7 by a contradiction. Thus, let us assume that the system is integrable. Then the group G • is Abelian. Again, we recall the Kimura theorem. Case A of this theorem cannot occur because ρ and σ are not rational so, by Lemma B.4, the difference of exponents τ must be an integer, however, this is excluded by an assumption. Case B of the Kimura theorem is also impossible, because ρ and σ are not rational. Hence, G • is not Abelian. The contradiction proves the theorem.

Final Remarks
When we started our analysis of the Bajer-Moffatt system (1.3), we did not expect to find many integrable cases. Thus, the fact that almost all the cases with a degree one Darboux polynomial are integrable was a surprise. This is why we distinguished and classified all the cases where the Bajer-Moffatt system (1.3) has a Darboux polynomial of degree one in variables.
In Lemma 4.1 we distinguish three families that admit a linear Darboux polynomial F of the form (4.24). A common level F(x) = F 0 (x) = 0 gives a particular phase curve, so we could potentially apply differential Galois methods to study the integrability of these cases. However, there are two difficulties that block this idea. First of all, necessary integrability conditions distinguish algebraic sets of codimension one in the space of parameters. When the number of parameters is large, then it is practically impossible to distinguish all of them. Moreover, the variational equations for this case does not reduce to the Riemann P equation, and this fact makes the problem even more difficult.
The key point in the proofs of Theorems 2.3-2.7 is the reduction of the variational equations to the Riemann P equation. Thanks to the Kimura theorem, we know all the cases where the identity component of the differential Galois group is solvable. Moreover, we supplement this analysis with a criterion, see Lemma B.4, which distinguishes cases where this group is Abelian. The system depends on three parameters; however, only two of them, μ 1 and μ 2 , play a crucial role. This is why we divided the (μ 1 , μ 2 ) plane into non-overlapping regions, and we performed our analyses in each of these regions separately.
Most interesting are the cases where the system satisfies the necessary conditions for integrability. In the parameter space (μ 1 , μ 2 , ω), they form surfaces. If a system is integrable, then the parameters necessarily belong to one of these surfaces. However, numerical tests show that generically the system is not integrable in these cases. Moreover, although we performed additional searches using the direct method, we did not find integrable cases.
The most peculiar case corresponds to a two-dimensional plane μ 1 = μ 2 in (μ 1 , μ 2 , ω) space. We performed intensive numerical tests just looking for signs of non-integrability, however without success. The Poincaré cross-sections are presented in Figs. 5 and 6. They present behaviour of trajectories where a necessary condition for integrability μω ∈ Z is fulfilled (see Fig. 5), as well as when it is not satisfied (see Fig. 6). Magnifications of regions shown in these figures are small, but we have searched for chaos in both cases in neighbourhoods of unstable periodic solutions of size 10 −5 − 10 −6 and we did not succeed. However, chaos appears immediately when we leave region C, i.e. when we take μ 1 = μ 2 > 1, see Fig. 8. This strange behaviour requires separate investigation.
Acknowledgements The authors thank Guy Casale for an explanation of why Corollary 3.7 from his work (Casale 2009) fits the settings of the integrability problems considered in this paper. This work was partially supported by the National Science Centre of Poland under Grant DEC-2013/09/B/ST1/04130.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

A Second-order Differential Equation with Rational Coefficients
Let us consider a second-order differential equation of the following form y = r (z)y, where r (z) is a rational function and the prime denotes differentiation with respect to z. The differential Galois group G of this equation is a linear algebraic subgroup of is an odd integer.
The above lemma shows that the Riemann equation is reducible if and only if its reduced form is reducible. Note that, if only one of the differences ρ, σ and τ is not rational, then the equation is not reducible. Thus, if it is reducible, then all these numbers are rational or one is rational and the remaining two are not rational. A more precise characterization of these cases is given in the following three lemmas.

Lemma B.2
Assume that the Eq. (B.2) is reducible and that its differential Galois group G is not a subgroup of the diagonal group. Then the identity component of G is Abelian if and only if ρ, σ and τ are rational.
Proof By assumptions, we are in the first case of Lemma A.2. If G = T, then G is connected and non-Abelian. Thus, by the same lemma, G = T m . Let v 1 (z) be the exponential solution of (B.2). Up to a multiplicative constant, it is unique. Then, for each g ∈ G, we have g(v 1 ) = av 1 for a certain non-zero a ∈ C. Again by Lemma A.2, we know that there exists m ∈ N such that a m = 1. Hence, g(v m 1 ) = a m v m 1 = v m 1 for each g ∈ G. This implies that v m 1 is a rational function. Moreover, we also know that v 1 (z) = z −e 0 (z − 1) −e 1 P(z), (B.8) where P(z) is a polynomial, and e 0 and e 1 are exponents at 0 and 1, respectively. The fact that v 1 (z) m is rational implies that me 0 and me 1 are integers. Thus, ρ and σ are rational numbers, and in turn, τ is also rational.
We also need one fact concerning the monodromy group of the Eq. (B.1). This group is generated by two matrices M 0 , M 1 ∈ GL(2, C). These matrices correspond to homotopy classes [γ 0 ] and [γ 1 ] of loops with one common point encircling once, in the positive sense, singularities z = 0 and z = 1, respectively. Then, we have the following lemma, see Lemma 4.3.5 on p. 90 in Iwasaki et al. (1991). Note that if M 0 is a scalar matrix, then ρ is an integer. In fact, eigenvalues of M 0 are λ k = e 2π iρ k . Thus, if M 0 = cId 2 , then c = e 2π iρ 1 = e 2π iρ 2 (B.9) and so, ρ = ρ 1 − ρ 2 ∈ Z.
If the difference of exponents at a singular point is an integer, then a local solution around this singularity may contain a logarithm. Such a singularity is called logarithmic. If a singularity of an equation is logarithmic, then neither its monodromy nor the differential Galois group is diagonalizable. Thus, we can formulate the following lemma.
Lemma B.4 Assume that the Eq. (B.2) is reducible. Then, the identity component of its differential Galois group is Abelian if either numbers ρ, σ and τ are rational, or two of them are not rational and one is an integer and the corresponding singularity is not logarithmic.
In the case of the Eq. (B.1), it is enough to know the exponents in order to determine which singularity is logarithmic. To formulate the next lemma, which gives the necessary and sufficient conditions for a singularity of (B.1) to be logarithmic, we introduce the following notation. For a non-negative integer m ∈ N 0 , we define For s ∈ {0, 1, ∞} let e s,1 and e s,2 denote the exponents of the Eq. (B.1), ordered in such a way that Re e s,1 ≥ Re e s,2 . With the above notation, we have the following. For the proof, see Lemma 4.7 and its proof on pp. 91-93 in Iwasaki et al. (1991). Assume that the Eq. (B.2) is reducible. We order the exponents in such a way that We assume here that Then, ρ − σ − τ = − (2k + 1) (B.13) and so ρ 2 + σ 2 + ρ 2 = 1 + k. (B.14) We assume that ρ = m ∈ N and σ, ρ / ∈ Q. If z = 0 is not a logarithmic singularity, then there exist i, j ∈ {1, 2} such that (B.15) For the Eq. (B.1), the necessary and sufficient conditions for solvability of the identity component of its differential Galois group are given by the Kimura theorem formulated in Kimura (1969), see also Morales Ruiz (1999).
If the identity component G • of the differential Galois group G of the Eq. (B.1) is solvable, but the equation is not reducible, i.e. if case A in the Kimura theorem does not occur, then the differential Galois group is either an imprimitive finite group (that corresponds to items 2-15 of the above table), or it is a subgroup of DP group. In the last case G can be either a finite subgroup DP or a whole DP group. The following lemma gives a criterion for the distinction of these two cases.
Lemma B.6 Suppose the Eq. (B.1) is not reducible. Then, its differential Galois group G is a subgroup of DP group if and only if the differences of exponents at two singular points are half integers. Moreover, G is a finite group if and only if the exponents at the remaining singular point are rational.
The above lemma is just case (b) of Theorem 2.9 from Churchill (1999).