1 Introduction

The cosine addition formula, cosine subtraction formula, and sine addition formula on any semigroup S for unknown functions \(g,f:S\rightarrow \mathbb {C}\) are, respectively, the functional equations

$$\begin{aligned} g(x\sigma (y))=g(x)g(y)-f(x)f(y), \end{aligned}$$
(1.1)
$$\begin{aligned} g(x\sigma (y))=g(x)g(y)+f(x)f(y), \end{aligned}$$
(1.2)
$$\begin{aligned} g(x\sigma (y))=g(x)f(y)+f(x)g(y), \end{aligned}$$
(1.3)

for all \(x,y\in S\), where \(\sigma :S\rightarrow S\) is an involutive automorphism. That is \(\sigma (xy)=\sigma (x)\sigma (y)\) and \(\sigma (\sigma (x))=x\) for all \(x,y\in S\). These functional equations have been investigated by many authors. In Vincze [11] obtained the solutions of (1.2) on abelian groups with \(\sigma =id\), and it was solved on general groups by Chung et al. [3] with \(\sigma =id\). The results were extended to the case of topological groups by Poulsen and Stetkær [7] and to semigroups generated by their squares by Ajebbar and Elqorachi [1], both papers with \(\sigma \) an involutive automorphism. Also Stetkær [10, Theorem 6.1] gave a description of the solution of (1.1) with \(\sigma =id\) on a general semigroup in terms of the solutions of (1.3) with \(\sigma =id\). The most recent result about (1.3) with \(\sigma =id\) was obtained by Ebanks [5, Theorem 2.1] and [6, Theorem 3.1] on semigroups. Ebanks [5, Theorem 4.1] gives the solution of (1.2) on monoids. Recently the authors [2] solved (1.1), (1.2) and (1.3) on semigroups.

Stetkær [10, Theorem 3.1] solved the functional equation

$$\begin{aligned} g(xy)=g(x)g(y)-f(x)f(y)+\alpha f(xy),\quad x,y\in S, \end{aligned}$$
(1.4)

on a semigroup S, where \(\alpha \in \mathbb {C}\) is a fixed constant. He expressed the solutions in terms of multiplitive functions on S and solutions \(h:S\rightarrow \mathbb {C}\) of the special case of the sine addition law

$$\begin{aligned} h(xy)=h(x)\chi (y)+h(y)\chi (x),\quad x,y\in S, \end{aligned}$$
(1.5)

in which \(\chi :S\rightarrow \mathbb {C}\) is a multiplicative function. Equation (1.4) generalizes both the cosine addition formula (1.1) and the cosine subtraction formula (1.2) with \(\sigma =id\).

As a continuation and a generalization of these investigations we determine the complex valued solutions of the functional equation

$$\begin{aligned} g(x\sigma (y))=g(x)g(y)-f(x)f(y)+\alpha f(x\sigma (y)),\quad x,y\in S, \end{aligned}$$
(1.6)

on semigroups, where \(\sigma :S\rightarrow S\) is an involutive automorphism. We obtain explicit formulas for the solutions expressed in terms of multiplicative, additive and sometimes arbitrary functions. The paper concludes with some examples.

Our notation is decribed in the following set up.

2 Set up and notation

Throughout this paper S denotes a semigroup and \(\sigma :S\rightarrow S\) an involutive automorphism.

A function \(a: S\rightarrow \mathbb {C}\) is additive if

$$\begin{aligned} a(xy) = a(x) + a(y) \quad \text {for all}\quad x, y\in S. \end{aligned}$$

A function \(\chi : S\rightarrow \mathbb {C}\) is multiplicative if

$$\begin{aligned} \chi (xy) = \chi (x)\chi (y)\quad \text {for all}\quad x, y \in S. \end{aligned}$$

A function \(f: S\rightarrow \mathbb {C}\) is central if \(f(xy) = f(yx)\) for all \(x, y\in S\), and f is abelian if f is central and \(f(xyz)=f(xzy)\) for all \(x,y,z\in S\).

For any subset \(T\subseteq S\) we define the set \(T^2:=\lbrace xy\ \vert \ x, y\in T\rbrace \), so \(T^2\) consists of all products of two (or more) elements of T.

The following remark follows easily from Stetkær [8, Corollary 3.19] and will be used throughout the paper without explicit mentioning.

Remark 2.1

If \(\chi _1\) and \(\chi _2\) are multiplicative functions on S such that \(\chi _1=-\chi _2\), then \(\chi _1=\chi _2=0\).

If \(\chi : S \rightarrow \mathbb {C}\) is a non-zero multiplicative function, we define the sets

$$\begin{aligned} I_{\chi }:= & {} \{x \in S \mid \chi (x)=0\}\\ P_\chi:= & {} \left\{ p\in I_{\chi }\backslash I_{\chi }^2\ \vert up, pv, upv\in I_{\chi }\backslash I_{\chi }^2\ \text {for all}\ u,v\in S\backslash I_{\chi }\right\} . \end{aligned}$$

For any function \(f: S \rightarrow \mathbb {C}\) we define the function

$$\begin{aligned} f^{*}(x):=f(\sigma (x)),\quad x \in S. \end{aligned}$$

We call \(f^{e}:=\frac{f+f^{*}}{2}\) the even part of f and \(f^{\circ }:=\frac{f-f^{*}}{2}\) its odd part. The function f is said to be even if \(f=f^{*}\), and f is said to be odd if \(f=-f^{*}\). In the following lemma we give some properties of the set \(P_\chi \).

Lemma 2.2

  1. (a)

    If \(u\in S\backslash I_\chi \) and \(p\in P_\chi \), then \(up,pu\in P_\chi \).

  2. (b)

    \(\sigma (P_\chi )=P_{\chi ^*}\). Note in particular that \(\sigma (P_\chi )=P_\chi \), if \(\chi =\chi ^*\).

Proof

  1. (a)

    follows directly from the definition of \(P_\chi \).

  2. (b)

    is easy to verify using that \(\sigma :S\rightarrow S\) is a bijection (See [4, Lemma 4.1]).

\(\square \)

For a topological semigroup S let C(S) denote the algebra of continuous functions from S into \(\mathbb {C}\).

3 The main result

The following lemmas will be used later.

Lemma 3.1

Let \(f,g:S\rightarrow \mathbb {C}\) be a solution of the functional equation

$$\begin{aligned} f(x\sigma (y))=\beta f(x)f(y)-\beta g(x)g(y), \end{aligned}$$
(3.1)

where \(g=0\) on \(S^2\) and \(\beta \in \mathbb {C}\backslash \lbrace 0\rbrace \) is a constant. Then f and g are linearly dependent.

Proof

If \(f=0\) or \(g=0\) then f and g are linearly dependent, so we may assume that \(f\ne 0\) and \(g\ne 0\). By applying (3.1) to the pair (xyz) and taking into account that \(g=0\) on \(S^2\) we obtain

$$\begin{aligned} f(xy\sigma (z))=\beta f(xy)f(z),\quad \text {for all}\quad x,y,z\in S. \end{aligned}$$
(3.2)

Now if we apply (3.1) to the pair \((x,\sigma (y)z)\) and take into account that \(g=0\) on \(S^2\) we get

$$\begin{aligned} f(xy\sigma (z))=\beta f(x)f(\sigma (y)z),\quad \text {for all}\quad x,y,z\in S. \end{aligned}$$
(3.3)

So we deduce from (3.2) and (3.3) since \(\beta \ne 0\) that

$$\begin{aligned} f(xy)f(z)=f(x)f(\sigma (y)z),\quad \text {for all}\quad x,y,z\in S. \end{aligned}$$

Then we get since \(f\ne 0\) that \(f(xy)=f(x)\phi (\sigma (y))\) for some function \(\phi :S\rightarrow \mathbb {C}\). Substituting this into (3.1) we find that

$$\begin{aligned} f(x)\phi (y)=\beta f(x)f(y)-\beta g(x)g(y). \end{aligned}$$

This implies that

$$\begin{aligned} \left[ \beta f(y)-\phi (y) \right] f=\beta g(y)g. \end{aligned}$$

Choosing \(y_0\in S\) such that \(g(y_0)\ne 0\) we see that f and g are linearly dependent. This completes the proof of Lemma 3.1. \(\square \)

Lemma 3.2

Let \(g,f:S\rightarrow \mathbb {C}\) be two functions such that

$$\begin{aligned} f=a_1\chi _1+a_2\chi _2\quad \text {and}\quad g=b_1\chi _1+b_2\chi _2, \end{aligned}$$

where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions, \(g\ne 0\) and \(a_1,a_2\in \mathbb {C}\backslash \lbrace 0\rbrace \), \(b_1,b_2\in \mathbb {C}\) are constants. We have

  1. (1)

    If f is even and g is odd, then \(a_1=a_2\) and \(b_1+b_2=0\).

  2. (2)

    If f is odd and g is even, then \(a_1+a_2=0\) and \(b_1=b_2\).

Proof

(1) If f is even and g is odd, we get that

$$\begin{aligned} a_1\chi _1+a_2\chi _2=a_1\chi _1^*+a_2\chi _2^*, \end{aligned}$$
(3.4)

and

$$\begin{aligned} b_1\chi _1+b_2\chi _2=-b_1\chi _1^*-b_2\chi _2^*. \end{aligned}$$
(3.5)

By the help of [10, Proposition A.2] we deduce from (3.4) that \(a_1\chi _1=a_1\chi _1^*\) or \(a_1\chi _1=a_2\chi _2^*\). If \(a_1\chi _1=a_1\chi _1^*\) then \(\chi _1=\chi _1^*\) since \(a_1\ne 0\), and then we get from (3.4) that \(\chi _2=\chi _2^*\) since \(a_2\ne 0\). In view of (3.5) we deduce that \(g=0\). This contradicts the fact that \(g\ne 0\). So \(a_1\chi _1=a_2\chi _2^*\) then since \(\chi _1,\chi _2\) are non-zero, \(a_1\ne 0\) and \(a_2\ne 0\), according to [8, Theorem 3.18 (a)] we deduce that \(\chi _1=\chi _2^*\) and then \(a_1=a_2\). Now (3.5) becomes \((b_1+b_2)(\chi _1+\chi _2)=0\) which implies that \(b_1+b_2=0\). This is case (1).

(2) We proceed similarly to case (1) to get the result. This completes the proof of Lemma 3.2. \(\square \)

In the following lemma we give some key properties of the solutions of Eq. (1.6).

Lemma 3.3

Let \(g,f:S\rightarrow \mathbb {C}\) be a solution of the functional Eq. (1.6), and define the function \(G:=g-\alpha f\). The following statements hold:

  1. (1)

    \(G(x\sigma (y))=G(y\sigma (x))\) for all \(x,y\in S\).

  2. (2)

    \(G(xyz)=G^*(xyz)\) for all \(x,y,z\in S\).

  3. (3)

    For all \(x,y,z\in S\)

    $$\begin{aligned} g^e(x)g^{\circ }(yz)= & {} f^e(x)f^{\circ }(yz), \end{aligned}$$
    (3.6)
    $$\begin{aligned} g^e(yz)g^{\circ }(x)= & {} f^e(yz)f^{\circ }(x). \end{aligned}$$
    (3.7)

Proof

(1) The functional Eq. (1.6) is equivalent to

$$\begin{aligned} G(x\sigma (y))=g(x)g(y)-f(x)f(y)\quad \text {for all}\quad x,y\in S. \end{aligned}$$
(3.8)

The right hand side of (3.8) is invariant under the interchange of x and y. That is

$$\begin{aligned} G(x\sigma (y))=G(y\sigma (x))\quad \text {for all}\quad x,y\in S. \end{aligned}$$
(3.9)

(2) Replacing y by \(\sigma (y)\) in (3.9), we get \(G(xy)=G^*(yx)\) for all \(x,y\in S\), and then we deduce that

$$\begin{aligned} G(xyz)=G^*(zxy)=G(yzx)=G^*(xyz)\quad \text {for all}\quad x,y,z\in S. \end{aligned}$$

(3) By applying the identity (3.8) to the pair \((x,\sigma (yz))\) we obtain

$$\begin{aligned} G(xyz)=g(x)g^*(yz)-f(x)f^*(yz)\quad \text {for all}\quad x,y,z\in S. \end{aligned}$$
(3.10)

Then by using (2), we deduce from (3.10) that

$$\begin{aligned} g(x)g^*(yz)-f(x)f^*(yz)=g^*(x)g(yz)-f^*(x)f(yz)\quad \text {for all}\quad x,y,z\in S. \nonumber \\ \end{aligned}$$
(3.11)

Since \(k=k^e+k^{\circ }\) and \(k^*=k^e-k^{\circ }\) for any function \(k:S\rightarrow \mathbb {C}\), we get from (3.11) after some rearrangement that for all \(x,y,z\in S\)

$$\begin{aligned} g^{\circ }(x)g^e(yz)-f^{\circ }(x)f^e(yz)=g^e(x)g^{\circ }(yz)-f^e(x)f^{\circ }(yz). \end{aligned}$$
(3.12)

In the identity (3.12) the left hand side is an odd function of x while the right is an even function of x, so

$$\begin{aligned} g^{\circ }(x)g^e(yz)-f^{\circ }(x)f^e(yz)=0, \end{aligned}$$
(3.13)

and

$$\begin{aligned} g^e(x)g^{\circ }(yz)-f^e(x)f^{\circ }(yz)=0, \end{aligned}$$
(3.14)

for all \(x,y,z\in S\). This completes the proof of Lemma 3.3. \(\square \)

Now we present the general solution of (1.6) on semigroups. Stetkær [10, Theorem 3.1] is Theorem 3.4 with \(\sigma =id\), and point (8) of Theorem 3.4 is new compared to [10].

Theorem 3.4

The solutions \(g,f:S\rightarrow \mathbb {C}\) of the functional Eq. (1.6) are the following families:

  1. (1)

    \(\alpha = \pm 1\), f is any non-zero function and \(g=\alpha f\).

  2. (2)

    \(\alpha \ne 1\), \(f=g\ne 0\) and \(g=0\) on \(S^2\).

  3. (3)

    \(\alpha \ne -1\), \(f=-g\ne 0\) and \(g=0\) on \(S^2\).

  4. (4)

    \(f=(q+\alpha )\dfrac{\chi }{2}\) and \(g=\left( 1\pm \sqrt{1+q^2-\alpha ^2} \right) \dfrac{\chi }{2} \), where \(q\in \mathbb {C}\) is a constant and \(\chi :S\rightarrow \mathbb {C}\) a non-zero even multiplicative function.

  5. (5)

    \(f=\alpha \dfrac{\chi _1+\chi _2}{2}+q\dfrac{\chi _1-\chi _2}{2}\) and \(g=\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2-\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero even multiplicative functions and \(q\in \mathbb {C}\backslash \lbrace \pm \alpha \rbrace \) is a constant.

  6. (6)

    \(\alpha \ne 0\), \(f=\alpha \chi _1\) and \(g=\chi _2\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero even multiplicative functions.

  7. (7)

    \(f=\alpha \chi +h\) and \(g=\chi \pm h\), where \(\chi :S\rightarrow \mathbb {C}\) is a non-zero even multiplicative function and \(h:S\rightarrow \mathbb {C}\) is a non-zero even solution of the special sine addition law (1.5).

  8. (8)

    \(\alpha \ne \pm 1\), and

    $$\begin{aligned} f=\dfrac{1+\alpha }{2}\chi -\dfrac{1-\alpha }{2}\chi ^*\quad \text {and}\quad g=\dfrac{1+\alpha }{2}\chi +\dfrac{1-\alpha }{2}\chi ^*, \end{aligned}$$

    where \(\chi :S\rightarrow \mathbb {C}\) is a multiplicative function such that \(\chi \ne \chi ^*\). Note that, off the exceptional case (1), g and f are abelian. Moreover, if S is a topological semigroup, \(f\in C(S)\) is such that \(f\ne \alpha \mu \) for any multiplicative function \(\mu \in C(S)\), then \(g\in C(S)\). In addition \(\chi ,\chi ^*\in C(S)\) in case (8).

Proof

It is easy to check that each of the pairs described in Theorem 3.4 is a solution of (1.6). So assume that the pair (gf) is a solution of Eq. (1.6). If \(g=0\), then (1.6) can be written as

$$\begin{aligned} \alpha f(x\sigma (y))=f(x)f(y),\quad x,y\in S. \end{aligned}$$

If \(\alpha =0\) then \(f=0\). This occurs in case (4) with \(q=-\alpha \). Now if \(\alpha \ne 0\), then

$$\begin{aligned} f(x\sigma (y))=\dfrac{1}{\alpha }f(x)f(y),\quad x,y\in S. \end{aligned}$$

Then according to [2, Lemma 4.1], \(f=\alpha \chi \), where \(\chi :S\rightarrow \mathbb {C}\) is an even multiplicative function. This occurs in case (4) with \(q=\alpha \). From now on we assume that \(g\ne 0\) and we discuss two cases according to whether g and f are linearly dependent or not.

First case: g and f are linearly dependent. There exists a constant \(c\in \mathbb {C}\) such that \(f=cg\). So (1.6) becomes

$$\begin{aligned} (1-\alpha c)g(x\sigma (y))=(1-c^2)g(x)g(y),\quad \text {for all}\quad x,y\in S. \end{aligned}$$

Then we obtain by proceeding exactly as in the proof of [10, Lemma4.3] and using [2, Lemma 4.1] the cases (1), (2), (3) and (4).

Second case: g and f are linearly independent.

Subcase A: \(g^{\circ }=0\) and \(f^{\circ }=0\). That is g and f are even, so if we replace y by \(\sigma (y)\), the functional Eq. (1.6) can be written as

$$\begin{aligned} g(xy)=g(x)g(y)-f(x)f(y)+\alpha f(xy)\quad x,y\in S. \end{aligned}$$

According to [10, Theorem 3.1] and taking into account that f and g are linearly independent and \(g\ne 0\) we have the following possibilities:

(i) \(f=\alpha \dfrac{\chi _1+\chi _2}{2}+q\dfrac{\chi _1-\chi _2}{2}\) and \(g=\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2-\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions and \(q\in \mathbb {C}\backslash \lbrace \pm \alpha \rbrace \) is a constant. So

$$\begin{aligned}f-\alpha g=\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\left( \chi _1-\chi _2 \right) . \end{aligned}$$

Since f and g are even, we see that

$$\begin{aligned} \dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\left( \chi _1-\chi _2 \right) =\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\left( \chi _1^*-\chi _2^* \right) . \end{aligned}$$
(3.15)

On the other hand the fact that g and f are linearly independent implies that \(f-\alpha g\ne 0\), and so \(\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\ne 0\). So (3.15) reduces to

$$\begin{aligned} \chi _1-\chi _2=\chi _1^*-\chi _2^*. \end{aligned}$$

Then since g is even, we get that

$$\begin{aligned} \chi _1+\chi _2=\chi _1^*+\chi _2^*. \end{aligned}$$

So, we deduce from the last two identities that \(\chi _1=\chi _1^*\) and \(\chi _2=\chi _2^*\). This occurs in case (5).

(ii) \(\alpha \ne 0\), \(f=\alpha \chi _1\) and \(g=\chi _2\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions. In addition since f and g are even, we deduce that \(\chi _1^*=\chi _1\) and \(\chi _2^*=\chi _2\). This is case (6).

(iii) \(f=\alpha \chi +h\) and \(g=\chi \pm h\), where \(h,\chi :S\rightarrow \mathbb {C}\) is a solution of the sine addition law

$$\begin{aligned} h(xy)=h(x)\chi (y)+h(y)\chi (x),\quad x,y\in S, \end{aligned}$$

such that \(\chi \ne 0\) is multiplicative and \(h\ne 0\). So \(f-\alpha g=(1\mp \alpha )h\), and \(1\pm \alpha \ne 0\) since f and g are linearly independent. Since f and g are even, we get that \(h^*=h\) and then \(\chi ^*=\chi \). This occurs in case (7).

Subcase B: \(g^{\circ }=0\) and \(f^{\circ }\ne 0\). In this case we deduce from (3.6) and (3.7) respectively that \(f^e(x)f^{\circ }(yz)=0\) and \(f^e(yz)=0\) for all \(x,y,z\in S\).

Subcase B.1: \(f^{\circ }=0\) on \(S^2\). That is \(f=0\) on \(S^2\) since \(f^e=0\) on \(S^2\). The functional Eq. (1.6) can be written as

$$\begin{aligned} g(x\sigma (y))=g(x)g(y)-f(x)f(y),\quad \text {for all}\quad x,y\in S. \end{aligned}$$

Since \(f\ne 0\) (\(f^{\circ }\ne 0\)) we get according to Lemma 3.1 that f and g are linearly dependent. This is a contradiction. This case does not occur.

Subcase B.2: \(f^{\circ }\ne 0\) on \(S^2\). This implies that \(f^e=0\), so if we replace y by \(\sigma (y)\), the functional Eq. (1.6) can be written as

$$\begin{aligned} g(xy)=g(x)g(y)+f(x)f(y)+\alpha f(xy),\quad x,y\in S. \end{aligned}$$

This means that the pair (gif) satisfies (1.4), where \(\alpha \) is replaced by \(-i\alpha \). According to [10, Theorem 3.1] and taking into account that g and f are linearly independent and \(g\ne 0\) we have the following possibilities:

  1. (i)

    \(if=-i\alpha \dfrac{\chi _1+\chi _2}{2}+q\dfrac{\chi _1-\chi _2}{2}\) and \(g=\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2+\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions and \(q\in \mathbb {C}\backslash \lbrace \pm i\alpha \rbrace \) is a constant. So

    $$\begin{aligned} f=\left( \dfrac{-\alpha -iq}{2} \right) \chi _1+\left( \dfrac{iq-\alpha }{2} \right) \chi _2, \end{aligned}$$

    and

    $$\begin{aligned} g=\left( \dfrac{1+\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _1+\left( \dfrac{1-\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _2, \end{aligned}$$

    or

    $$\begin{aligned} g=\left( \dfrac{1-\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _1+\left( \dfrac{1+\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _2. \end{aligned}$$

    Since \(q\ne \pm i\alpha \), we see that \(\alpha \ne \pm iq\). Then since f is odd and g is even we get according to Lemma 3.2 (2) that

    $$\begin{aligned} \dfrac{-\alpha -iq}{2} +\dfrac{iq-\alpha }{2}=0\end{aligned}$$

    and

    $$\begin{aligned} \dfrac{1-\sqrt{1+q^2+\alpha ^2}}{2}=\dfrac{1+\sqrt{1+q^2+\alpha ^2}}{2}. \end{aligned}$$

    Then \(\alpha =0\) and \(\sqrt{1+q^2+\alpha ^2}=0\). This implies that \(iq=\pm 1\), so

    $$\begin{aligned} f=\pm \left( \dfrac{\chi _2-\chi _1}{2} \right) , \end{aligned}$$

    and

    $$\begin{aligned} g= \left( \dfrac{\chi _1+\chi _2}{2}\right) . \end{aligned}$$

    This occurs in case (8) with \(\alpha =0\), \(\chi :=\chi _1\) and \(\chi ^*:=\chi _2\) or \(\chi :=\chi _2\) and \(\chi ^*:=\chi _1\).

  2. (ii)

    \(\alpha \ne 0\), \(if=-i\alpha \chi _1\) and \(g=\chi _2\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions. Then \(f=-\alpha \chi _1\). In addition since f is odd, we deduce that \(\chi _1^*=-\chi _1\). Then \(\chi _1=0\), contradicting \(\chi _1\ne 0\). So case (ii) does not occur.

  3. (iii)

    \(if=-i\alpha \chi +h\) and \(g=\chi \pm h\), where \(\chi ,h:S\rightarrow \mathbb {C}\) is a solution of (1.5). Then \(f=-\alpha \chi -ih\). If \(g=\chi +h\), we get that

$$\begin{aligned} f+ig=(i-\alpha )\chi , \end{aligned}$$

and then since f is odd and g is even

$$\begin{aligned} ig-f=(i-\alpha )\chi ^*. \end{aligned}$$

By adding the last two identities we obtain \(g=(i-\alpha )\dfrac{\chi +\chi ^*}{2i}\), and then \(f=(i-\alpha )\dfrac{\chi -\chi ^*}{2}\). The fact that \(f\ne 0\) implies \(\chi \ne \chi ^*\) and \(\alpha \ne i\). Substituting the forms of f and g in (1.6) we get after reduction that

$$\begin{aligned} \chi (x)\left[ (1-i\alpha )\chi ^*(y)-(1+i\alpha )\chi (y) \right] +(1+i\alpha )\chi ^*(x)\left[ \chi (y)-\chi ^*(y) \right] =0, \end{aligned}$$

for all \(x,y\in S\). Then since \(\chi \ne \chi ^*\) we deduce that \(1+i\alpha =0\). That is \(\alpha =i\), so this case does not occur since \(\alpha \ne i\). For the case \(g=\chi -h\) we proceed in the same way to get that \(g=(i+\alpha )\dfrac{\chi +\chi ^*}{2i}\) and \(f=(i+\alpha )\dfrac{\chi -\chi ^*}{2}\) with \(\chi \ne \chi ^*\) and \(\alpha \ne -i\). Similarly to the previous case we get by substitution that \(\alpha =-i\). This case does not occur.

Subcase C: \(g^{\circ } \ne 0\) and \(f^{\circ } =0\). We deduce from (3.6) and (3.7) respectively that \(g^e(x)g^{\circ }(yz)=0\) and \(g^e(yz)=0\) for all \(x,y,z\in S\).

Subcase C.1: \(g^{\circ } = 0\) on \(S^2\). Then \(g=0\) on \(S^2\) since \(g^e=0\) on \(S^2\), so the functional Eq. (1.6) becomes

$$\begin{aligned} 0=g(x)g(y)-f(x)f(y)+\alpha f(x\sigma (y)),\quad x,y\in S. \end{aligned}$$

That is

$$\begin{aligned} \alpha f(x\sigma (y))=f(x)f(y)-g(x)g(y),\quad x,y\in S. \end{aligned}$$

Since f and g are linearly independent, we see that \(\alpha \ne 0\), so for all \(x,y\in S\)

$$\begin{aligned} f(x\sigma (y))=\dfrac{1}{\alpha } f(x)f(y)-\dfrac{1}{\alpha } g(x)g(y). \end{aligned}$$

Then according to Lemma 3.1 we get that f and g are linearly dependent. This is a contradiction. This case does not occur.

Subcase C.2: \(g^{\circ } \ne 0\) on \(S^2\). In this case we get that \(g^e=0\), so if we replace y by \(\sigma (y)\) the functional Eq. (1.6) can be written as

$$\begin{aligned} g(xy)=-g(x)g(y)-f(x)f(y)+\alpha f(xy),\quad x,y\in S. \end{aligned}$$

This means that the pair \((-g,if)\) satisfies the functional Eq. (1.4), where \(\alpha \) is replaced by \(i\alpha \). According to [10, Theorem 3.1] and taking into account that g and f are linearly independent we have the following cases

(i) \(if=i\alpha \dfrac{\chi _1+\chi _2}{2}+q\dfrac{\chi _1-\chi _2}{2}\) and \(-g=\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2+\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions and \(q\in \mathbb {C}\backslash \lbrace \pm i\alpha \rbrace \) is a constant. Then

$$\begin{aligned} f=\left( \dfrac{\alpha -iq}{2} \right) \chi _1+\left( \dfrac{\alpha +iq}{2} \right) \chi _2, \end{aligned}$$

and

$$\begin{aligned} g=\left( \dfrac{-1-\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _1+\left( \dfrac{-1+\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _2, \end{aligned}$$

or

$$\begin{aligned} g=\left( \dfrac{-1+\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _1+\left( \dfrac{-1-\sqrt{1+q^2+\alpha ^2}}{2} \right) \chi _2. \end{aligned}$$

Since \(q\ne \pm i\alpha \), we see that \(\alpha \ne \pm iq\). Then since f is even and g is odd we get according to the statement \(b_1+b_2=0\) in Lemma 3.2 (1) that

$$\begin{aligned} \dfrac{-1+\sqrt{1+q^2+\alpha ^2}}{2}+\dfrac{-1-\sqrt{1+q^2+\alpha ^2}}{2}=0. \end{aligned}$$

This case does not occur.

(ii) \(\alpha \ne 0\), \(if=i\alpha \chi _1\) and \(-g=\chi _2\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions. Then \(f=\alpha \chi _1\) and \(g=-\chi _2\). In addition since g is odd and f is even, we deduce that \(\chi _1^*=\chi _1\) and \(\chi _2^*=-\chi _2\). This means that \(\chi _2=0\). This case does not occur.

(iii) \(if=i\alpha \chi +h\) and \(-g=\chi \pm h\), where \(\chi ,h:S\rightarrow \mathbb {C}\) is a solution of (1.5). So \(f=\alpha \chi -ih\) and \(g=-\chi \pm h\). Suppose that \(g=-\chi -h\), to get that

$$\begin{aligned} f-ig=(\alpha +i)\chi , \end{aligned}$$

then since f is even and g is odd we deduce that

$$\begin{aligned} f+ig=(\alpha +i)\chi ^*. \end{aligned}$$

By adding the last two identities, we get that

$$\begin{aligned} f=\dfrac{\alpha +i}{2}\left[ \chi +\chi ^* \right] , \end{aligned}$$

and then

$$\begin{aligned} g=\dfrac{\alpha +i}{2i}\left[ \chi ^*-\chi \right] . \end{aligned}$$

The fact that \(g\ne 0\) implies that \(\chi \ne \chi ^*\) and \(\alpha \ne -i\). Substituting the forms of g and f in (1.6) we get that for all \(x,y\in S\)

$$\begin{aligned} \chi (x)\left[ (i\alpha -1)\chi (y)-(i\alpha +1)\chi ^*(y)\right] +\chi ^*(x)(1-i\alpha )\left[ \chi (y)-\chi ^*(y) \right] =0. \end{aligned}$$

Then since \(\chi \ne \chi ^*\), we deduce that \(1-i\alpha =0\). That is \(\alpha =-i\). This contradicts the fact that \(\alpha \ne -i\), so this case does not occur.

Now if \(g=-\chi +h\), we get in the same way that \(f=\dfrac{\alpha -i}{2}\left[ \chi +\chi ^* \right] \) and \(g=\dfrac{\alpha -i}{2i}\left[ \chi -\chi ^* \right] \), where \(\chi \ne \chi ^*\) and \(\alpha \ne i\), and then by substitution that \(\alpha =i\). This case does not occur.

Subcase D: \(g^{\circ }\ne 0\) and \(f^{\circ }\ne 0\).

Subcase D.1: \(g^{\circ }= 0\) on \(S^2\) and \(f^{\circ }= 0\) on \(S^2\). That is \(g=g^e\) on \(S^2\) and \(f=f^e\) on \(S^2\), and from (3.7) we deduce that \(f^e=cg^e\) on \(S^2\) for some constant \(c\in \mathbb {C}\). That is \(f=cg\) on \(S^2\), so the functional Eq. (1.6) can be written as

$$\begin{aligned} (1-c\alpha )g(x\sigma (y))=g(x)g(y)-f(x)f(y). \end{aligned}$$

Since g and f are linearly independent, we see that \(\beta :=1-c\alpha \ne 0\). Then

$$\begin{aligned} g(x\sigma (y))=\dfrac{1}{\beta }g(x)g(y)-\dfrac{1}{\beta }f(x)f(y). \end{aligned}$$

This means that the pair \(\left( \dfrac{1}{\beta }g,\dfrac{i}{\beta }f \right) \) satisfies the functional Eq. (1.2), so taking into account that g and f are linearly independent we get from [2, Theorem 4.2] that \(\dfrac{1}{\beta }g\) is even. This is a contradiction since \(g^{\circ }\ne 0\). This case does not occur.

Subcase D.2: \(g^{\circ }= 0\) on \(S^2\) and \(f^{\circ }\ne 0\) on \(S^2\). We get from (3.6) that \(f^e=0\), then from (3.7) that \(g^e=0\) on \(S^2\). That is \(g=0\) on \(S^2\). The functional Eq. (1.6) becomes

$$\begin{aligned} \alpha f(x\sigma (y))=f(x)f(y)-g(x)g(y). \end{aligned}$$

Since g and f are linearly independent, we see that \(\alpha \ne 0\), so

$$\begin{aligned} f(x\sigma (y))=\dfrac{1}{\alpha }f(x)f(y)-\dfrac{1}{\alpha }g(x)g(y). \end{aligned}$$

So we get according to Lemma 3.1 that f and g are linearly dependent. This is a contradiction. This case does not occur.

Subcase D.3: \(g^{\circ }\ne 0\) on \(S^2\) and \(f^{\circ }= 0\) on \(S^2\). We deduce from (3.6) that \(g^e=0\), and then by using (3.7) we get that \(f^e=0\) on \(S^2\). This implies that \(f=0\) on \(S^2\), and (1.6) can be written as

$$\begin{aligned} g(x\sigma (y))=g(x)g(y)-f(x)f(y). \end{aligned}$$

Since \(f\ne 0\) (\(f^{\circ }\ne 0\)) we get according to Lemma 3.1 that f and g are linearly dependent. This case does not occur.

Subcase D.4: \(g^{\circ }\ne 0\) on \(S^2\) and \(f^{\circ }\ne 0\) on \(S^2\). By using (3.6) we get that

$$\begin{aligned} g^e=\delta f^e, \end{aligned}$$
(3.16)

for some constant \(\delta \in \mathbb {C}\).

Subcase D.4.1: \(f^e= 0\). So \(g^e=0\), and then if we replace y by \(\sigma (y)\) the functional Eq. (1.6) becomes

$$\begin{aligned} g(xy)=-g(x)g(y)+f(x)f(y)+\alpha f(xy). \end{aligned}$$

This means that the pair \(\left( -g,f \right) \) satisfies (1.4), where \(\alpha \) is replaced by \(-\alpha \). According to [10, Theorem 3.1] and taking into account that g and f are linearly independent we have the following cases

(i) \(f=-\alpha \dfrac{\chi _1+\chi _2}{2}+q\dfrac{\chi _1-\chi _2}{2}\) and \(-g=\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2-\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions and \(q\in \mathbb {C}\backslash \lbrace \pm \alpha \rbrace \) is a constant. Then \(g=-\dfrac{\chi _1+\chi _2}{2}\pm \sqrt{1+q^2-\alpha ^2}\dfrac{\chi _1-\chi _2}{2}\).

So \(f-\alpha g=\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\left( \chi _1-\chi _2 \right) \), and \(\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}\ne 0\) since g and f are linearly independent. The fact that f and g are odd implies that

$$\begin{aligned}\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}(\chi _1-\chi _2)=\dfrac{q\pm \alpha \sqrt{1+q^2-\alpha ^2}}{2}(\chi _2^*-\chi _1^*). \end{aligned}$$

This implies that

$$\begin{aligned} \chi _1-\chi _2=\chi _2^*-\chi _1^*. \end{aligned}$$

Then, since g is odd we get that

$$\begin{aligned} \chi _1+\chi _2=-(\chi _1^*+\chi _2^*). \end{aligned}$$

So we deduce from the last two identities that \(\chi _1=-\chi _1^*\) and \(\chi _2=-\chi _2^*\). This implies that \(\chi _1=\chi _2=0\). This case does not occur.

(ii) \(\alpha \ne 0\), \(f=-\alpha \chi _1\) and \(-g=\chi _2\), where \(\chi _1,\chi _2:S\rightarrow \mathbb {C}\) are two different non-zero multiplicative functions. Then \(g=-\chi _2\). In addition since g and f are odd, we deduce that \(\chi _1^*=-\chi _1\) and \(\chi _2^*=-\chi _2\). That is \(\chi _1=\chi _2=0\). This case does not occur.

(iii) \(f=-\alpha \chi +h\) and \(-g=\chi \pm h\), where \(\chi :S\rightarrow \mathbb {C}\) is a non-zero multiplicative function and \(h:S\rightarrow \mathbb {C}\) is a solution of (1.5). So \(g=-\chi \mp h\). Then \(f-\alpha g=(1\pm \alpha )h\) and \(1\pm \alpha \ne 0\) since g and f are linearly independent. Since g and f are odd, we see that \(h=-h^*\), and then \(\chi =-\chi ^*\). This implies that \(\chi =0\). This case does not occur.

Subcase D.4.2: \(f^e\ne 0\). We get from (3.6) that \(f^{\circ }=bg^{\circ }\) on \(S^2\) for some constant \(b\in \mathbb {C}\) and \(\delta \ne 0\).

Subcase D.4.2.1: \(f^e= 0\) on \(S^2\). So \(g^e=0\) on \(S^2\) by (3.16). That is \(f=bg\) on \(S^2\) since \(f^e=g^e=0\) on \(S^2\). The functional Eq. (1.6) can be written as

$$\begin{aligned} (1-b\alpha )g(x\sigma (y))=g(x)g(y)-f(x)f(y). \end{aligned}$$

The fact that g and f are linearly independent implies that \(\gamma :=1-b\alpha \ne 0\), so we get

$$\begin{aligned} g(x\sigma (y))=\dfrac{1}{\gamma } g(x)g(y)-\dfrac{1}{\gamma } f(x)f(y). \end{aligned}$$

This means that the pair \(\left( \dfrac{1}{\gamma } g,\dfrac{i}{\gamma }f\right) \) satisfies (1.2), then since f and g are linearly independent we get from [2, Theorem 4.2] that \(\dfrac{1}{\gamma } g\) is even. This contradicts the fact that \(g^{\circ }\ne 0\) here in subcase D. This case does not occur.

Subcase D.4.2.2: \(f^e\ne 0\) on \(S^2\). In this case we get from (3.7) that \(f^{\circ }=ag^{\circ }\) for some constant \(a\in \mathbb {C}\), and \(a\ne 0\) since \(f^{\circ }\ne 0\). So

$$\begin{aligned} g^{\circ }=\dfrac{1}{a}f^{\circ }. \end{aligned}$$

So with (3.16), Eq. (3.6) becomes

$$\begin{aligned} \dfrac{\delta }{a}f^e(x)f^{\circ }(yz)=f^e(x)f^{\circ }(yz), \end{aligned}$$

for all \(x,y,z\in S\). This implies that \(\dfrac{\delta }{a}=1\), and then \(\delta =a\ne 0\), so we get that

$$\begin{aligned} g^{\circ }=\dfrac{1}{\delta }f^{\circ }. \end{aligned}$$
(3.17)

By adding (3.17) to (3.16) we get that

$$\begin{aligned} g=\delta f^e+\dfrac{1}{\delta }f^{\circ }. \end{aligned}$$
(3.18)

Since f and g are linearly independent, we see from (3.18) that \(\delta \ne \pm 1\). So in view of (3.18) the functional Eq. (1.6) becomes

$$\begin{aligned} (\delta -\alpha )f^e(x\sigma (y))+\left( \dfrac{1}{\delta }-\alpha \right) f^{\circ }(x\sigma (y))=g(x)g(y)-f(x)f(y). \end{aligned}$$
(3.19)

If we apply (3.19) first to the pair \((x,\sigma (y))\) and then to the pair \((\sigma (x),y)\) we get respectively the following two identities

$$\begin{aligned}{} & {} (\delta -\alpha )f^e(xy)+\left( \dfrac{1}{\delta }-\alpha \right) f^{\circ }(xy)=g(x)g^*(y)-f(x)f^*(y). \end{aligned}$$
(3.20)
$$\begin{aligned}{} & {} (\delta -\alpha )f^e(xy)-\left( \dfrac{1}{\delta }-\alpha \right) f^{\circ }(xy)=g^*(x)g(y)-f^*(x)f(y). \end{aligned}$$
(3.21)

By adding (3.20) to (3.21) and taking into account that \(k^*=k^e-k^{\circ }\) and \(k=k^e+k^{\circ }\) for any function \(k:S\rightarrow \mathbb {C}\) we get

$$\begin{aligned} (\delta -\alpha )f^e(xy)=g^e(x)g^e(y)-g^{\circ }(x)g^{\circ }(y)-f^e(x)f^e(y)+f^{\circ }(x)f^{\circ }(y). \nonumber \\ \end{aligned}$$
(3.22)

Now by using (3.16) and (3.17), the identitiy (3.22) becomes

$$\begin{aligned} (\delta -\alpha )f^e(xy)=(\delta ^2-1)f^e(x)f^e(y)+\left( 1-\dfrac{1}{\delta ^2} \right) f^{\circ }(x)f^{\circ }(y). \end{aligned}$$
(3.23)

Since \(\delta \ne \pm 1\) and \(f^e\ne 0\), we see from (3.23) that \(\alpha \ne \delta \), and if we apply (3.23) to the pair \((\sigma (y),x)\) we get

$$\begin{aligned} (\delta -\alpha )f^e(\sigma (y)x)=(\delta ^2-1)f^e(x)f^e(y)-\left( 1-\dfrac{1}{\delta ^2} \right) f^{\circ }(x)f^{\circ }(y). \end{aligned}$$
(3.24)

By adding (3.24) to (3.23) we get since \(\alpha \ne \delta \)

$$\begin{aligned} f^e(xy)+f^e(\sigma (y)x)=\dfrac{2(\delta ^2-1)}{\delta -\alpha }f^e(x)f^e(y). \end{aligned}$$
(3.25)

According to [9, Theorem 2.1] we deduce from (3.25) that

$$\begin{aligned} f^e=\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi +\chi ^*\right) , \end{aligned}$$
(3.26)

where \(\chi :S\rightarrow \mathbb {C}\) is multiplicative. \(\chi \) is non-zero since \(f^e\ne 0\). Substituting (3.26) in (3.23) and taking into account that \(f^{\circ }\ne 0\) we obtain

$$\begin{aligned} f^{\circ }=\mp \left( \dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)}\right) \left( \chi -\chi ^*\right) , \end{aligned}$$
(3.27)

and \(\chi \ne \chi ^*\), so we deduce from (3.26) and (3.27) that

$$\begin{aligned} f=\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi +\chi ^*\right) +\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi -\chi ^*\right) , \end{aligned}$$

or

$$\begin{aligned} f=\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi +\chi ^*\right) -\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi -\chi ^*\right) , \end{aligned}$$

and then by using (3.16) and (3.17) that

$$\begin{aligned} g=\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi +\chi ^*\right) +\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi -\chi ^*\right) , \end{aligned}$$

or

$$\begin{aligned} g=\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi +\chi ^*\right) -\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi -\chi ^*\right) . \end{aligned}$$

So we deduce that

$$\begin{aligned} \begin{matrix} f=\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi +\chi ^*\right) +\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi -\chi ^*\right) \\ g=\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi +\chi ^*\right) +\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi -\chi ^*\right) \\ \end{matrix}, \end{aligned}$$
(3.28)

or

$$\begin{aligned} \begin{matrix} f=\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi +\chi ^*\right) -\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi -\chi ^*\right) \\ g=\dfrac{\delta (\delta -\alpha )}{2(\delta ^2-1)} \left( \chi +\chi ^*\right) -\dfrac{\delta -\alpha }{2(\delta ^2-1)} \left( \chi -\chi ^*\right) \\ \end{matrix}. \end{aligned}$$
(3.29)

By substituting (3.28) and (3.29) in (1.6) we deduce after reduction that \(\delta \alpha =1\). That is \(\delta =\dfrac{1}{\alpha }\), and then we get that

$$\begin{aligned} f=\dfrac{1+\alpha }{2}\chi -\dfrac{1-\alpha }{2}\chi ^*\quad \text {and}\quad g=\dfrac{1+\alpha }{2}\chi +\dfrac{1-\alpha }{2}\chi ^*, \end{aligned}$$

or

$$\begin{aligned} f=\dfrac{1+\alpha }{2}\chi ^*-\dfrac{1-\alpha }{2}\chi \quad \text {and}\quad g=\dfrac{1+\alpha }{2}\chi ^*+\dfrac{1-\alpha }{2}\chi , \end{aligned}$$

where \(\alpha \ne \pm 1\). This occurs in case (8).

Finally, if S is a topological semigroup, we get the continuity of g in cases (1), (2), (3), (4), (5) and (7) from the continuity of f by proceeding like in the proof of [10, Proposition 5.1]. Case (6) contains the excluded form of f. For case (8) we get according to [8, Theorem 3.18(d)] from

$$\begin{aligned} f=\dfrac{1+\alpha }{2}\chi -\dfrac{1-\alpha }{2}\chi ^*\in C(S), \end{aligned}$$

that \((1+\alpha )\chi ,(1-\alpha )\chi ^*\in C(S)\). So \(\alpha \ne \mp 1\) implies that \(\chi ,\chi ^*\in C(S)\), then \(g\in C(S)\) as a linear combination of two continuous functions. This completes the proof of Theorem 3.4. \(\square \)

Remark 3.1

Theorem 3.4(7) can by the help of Ebanks [6, Theorem 3.1(B)] be formulated in more details as follows:

\(f=\alpha \chi +h\) and \(g=\chi \pm h\) such that

$$\begin{aligned} h=\left\{ \begin{array}{lll} \chi A &{}\quad on &{}\quad S\backslash {{I}_{\chi }} \\ 0 &{} \quad on &{} \quad {{I}_{\chi }}\backslash {{P}_{\chi }} \\ \rho &{} \quad on &{}\quad {{P}_{\chi }} \\ \end{array},\right. \end{aligned}$$

where \(\chi :S\rightarrow \mathbb {C}\) is an even non-zero multiplicative function, \(A:S\backslash I_{\chi }\rightarrow \mathbb {C}\) an additive function such that \(A\circ \sigma =A\), and \(\rho :P_\chi \rightarrow \mathbb {C}\) a function such that \(\rho \circ \sigma =\rho \). In addition we have the following conditions.

  1. (I):

    If \(x\in \lbrace up,pv,upv\rbrace \) for \(p\in P_{\chi }\) and \(u,v\in S\backslash I_{\chi }\), then we have respectively \(\rho (x)=\rho (p)\chi (u)\), \(\rho (x)=\rho (p)\chi (v)\), or \(\rho (x)=\rho (p)\chi (uv)\).

  2. (II):

    \(h(xy)=h(yx)=0\) for all \(x\in I_{\chi }\backslash P_{\chi }\) and \(y\in S\backslash I_{\chi }\).

4 Examples

In this section we give some examples of solutions of the functional Eq. (1.6).

Example 4.1

Let \(S=(\mathbb {R},+)\) under the usual topology, and let \(\sigma :\mathbb {R}\rightarrow \mathbb {R}\) be the involution defined by \(\sigma (x)=-x\) for all \(x\in \mathbb {R}\). The functional Eq. (1.6) can be written as

$$\begin{aligned} g(x-y)=g(x)g(y)-f(x)f(y)+\alpha f(x-y), \end{aligned}$$
(4.1)

where \(f,g:\mathbb {R}\rightarrow \mathbb {C}\). We determine the continuous solutions of (4.1). The case \(\alpha =0\) is [8, Example 4.18] where the function f is replaced by if. The continuous non-zero multiplicative functions on S are the functions

$$\begin{aligned} \chi (x)=e^{i\lambda x},\quad x\in \mathbb {R}, \end{aligned}$$
(4.2)

where \(\lambda \in \mathbb {C}\). The only even, non-zero multiplicative function \(\chi \) on S is \(\chi =1\). The only even, additive fonction a on S is \(a=0\). The solutions \(f,g\in C(S)\) of (4.1) are the following:

  1. (a)

    \(\alpha =\pm 1\), f is any non-zero continuous function on S and \(g=\alpha f\).

  2. (b)

    \(f=\dfrac{q+\alpha }{2}\) and \(g=\dfrac{1\pm \sqrt{1+q^2-\alpha ^2}}{2}\), where \(q\in \mathbb {C}\) is a constant.

  3. (c)

    \(f(x)=\dfrac{1+\alpha }{2}e^{i\lambda x}- \dfrac{1-\alpha }{2}e^{-i\lambda x}\) and \(g(x)=\dfrac{1+\alpha }{2}e^{i\lambda x}+\dfrac{1-\alpha }{2}e^{-i\lambda x}\), where \(\lambda \in \mathbb {C}\backslash \lbrace 0\rbrace \) and \(\alpha \ne \mp 1\).

Example 4.2

Let \(S=H_3\) be the Heisenberg group defined by

$$\begin{aligned}H_3=\left\{ \left( \begin{matrix} 1 &{}\quad x &{}\quad z \\ 0 &{}\quad 1 &{}\quad y \\ 0 &{}\quad 0 &{}\quad 1 \\ \end{matrix} \right) \mid \quad x,y,z\in \mathbb {R} \right\} , \end{aligned}$$

and let

$$\begin{aligned}X=\left( \begin{matrix} 1 &{}\quad x &{}\quad z \\ 0 &{}\quad 1 &{}\quad y \\ 0 &{}\quad 0 &{}\quad 1 \\ \end{matrix} \right) ,\end{aligned}$$

for all \(x,y,z\in \mathbb {R}\). We consider the following involution

$$\begin{aligned} \sigma \left( X \right) =\left( \begin{matrix} 1 &{}\quad -x &{}\quad z \\ 0 &{}\quad 1 &{}\quad -y \\ 0 &{}\quad 0 &{}\quad 1 \\ \end{matrix} \right) . \end{aligned}$$

According to [8, Example 3.14], the continuous non-zero multiplicative functions on S have the form

$$\begin{aligned} \chi \left( X \right) =e^{ax+by}, \end{aligned}$$
(4.3)

where \(a,b\in \mathbb {C}\). The only even, non-zero multiplicative function \(\chi \) on S is \(\chi =1\). So the continuous solutions of Eq. (1.6) are the following three types:

  1. (1)

    \(\alpha =\pm 1\), f is any non-zero continuous function on S and \(g=\alpha f\).

  2. (2)

    \(f(X)=\dfrac{q+\alpha }{2}\) and \(g(X)=\dfrac{1\pm \sqrt{1+q^2-\alpha ^2}}{2}\), where \(q\in \mathbb {C}\).

  3. (3)

    \(\alpha \ne \pm 1\), and

    $$\begin{aligned} \begin{matrix} f(X)=\dfrac{1+\alpha }{2}e^{ax+by}-\dfrac{1-\alpha }{2}e^{-ax-by},\\ g(X)=\dfrac{1+\alpha }{2}e^{ax+by}+\dfrac{1-\alpha }{2}e^{-ax-by}, \\ \end{matrix} \end{aligned}$$

    where \((a,b)\ne (0,0)\).

In the following example we shall apply our theory to a semigroup S such that \(S^2\ne S\).

Example 4.3

Let \(S=\left( \mathbb {N}\backslash \lbrace 1\rbrace ,\cdot \right) \), and let \(\chi :S\rightarrow \mathbb {C}\) be the multiplicative function defined by

$$\begin{aligned} \chi (x):=\left\{ \begin{array}{lll} 1 &{}\quad for &{}\quad x\in \mathbb {N}\backslash \left( 2\mathbb {N}\cup \lbrace 1\rbrace \right) \\ 0 &{}\quad for &{}\quad x\in 2\mathbb {N} \\ \end{array}. \right. \end{aligned}$$

Then \(I_{\chi }=2\mathbb {N}\) and \(P_{\chi }=2\mathbb {N}\backslash 4\mathbb {N}\). We let \(\sigma :=id\) be the identity function. So \(\chi \) is even with respect to \(\sigma \). An additive function \(A:\mathbb {N}\backslash \left( 2\mathbb {N}\cup \lbrace 1\rbrace \right) \rightarrow \mathbb {C}\) is defined by

$$\begin{aligned} A(x):=\text {the number of times 5 occurs in the prime factorization of}\ x. \end{aligned}$$

In Remark 3.1, the form of the function \(h:\mathbb {N}\backslash \lbrace 1\rbrace \rightarrow \mathbb {C}\) is

$$\begin{aligned} h(x):=\left\{ \begin{array}{lll} A(x) &{}\quad for &{}\quad x\in \mathbb {N}\backslash \left( 2\mathbb {N}\cup \left\{ 1 \right\} \right) \\ 0 &{}\quad for &{}\quad x\in 4\mathbb {N} \\ \rho &{}\quad for &{}\quad x\in 2\mathbb {N}\backslash 4\mathbb {N} \\ \end{array},\right. \end{aligned}$$

where \(\rho :2\mathbb {N}\backslash 4\mathbb {N}\rightarrow \mathbb {C}\) is a function satisfying condition (I). So

$$\begin{aligned}h(2(2n+1))=\rho (2)\chi (2n+1)=\rho (2)\quad \text {for all}\ n\in \mathbb {N}. \end{aligned}$$

This implies that \(\rho (x)=c\) for all \(x\in 2\mathbb {N}\backslash 4\mathbb {N}\), where \(c:=\rho (2)\in \mathbb {C}\). That is

$$\begin{aligned} h(x)=\left\{ \begin{array}{lll} A(x) &{}\quad for &{}\quad x\in \mathbb {N}\backslash \left( 2\mathbb {N}\cup \left\{ 1 \right\} \right) \\ 0 &{}\quad for &{}\quad x\in 4\mathbb {N} \\ c &{}\quad for &{}\quad x\in 2\mathbb {N}\backslash 4\mathbb {N} \\ \end{array}.\right. \end{aligned}$$

So condition (II) is satisfied. We get the solutions \(f,g:S\rightarrow \mathbb {C}\) of Eq. (1.6) by plugging the appropriate forms above into the formula of Theorem 3.4 and Remark 3.1.

For the semigroup S we have that \(S^2=S\backslash \mathbb {P}\), where \(\mathbb {P}\) denotes the set of all prime numbers, and also S is neither a monoid nor generated by its squares, so we can see that we can not avoid the cases (2), (3) and (7) from Theorem 3.4.