Let S be a semigroup, and let ϕ,ψ:S→S be two endomorphisms (which are not necessarily involutive). Our main goal in this paper is to solve the following generalized variant of d’Alembert’s functional equation
f(xϕ(y))+f(ψ(y)x) = 2f(x)f(y), x,y∈S,
where f:S→ℂ is the unknown function by expressing its solutions in terms of multiplicative functions. Some consequences of this result are presented.