Solve functional equations using substitution (#373)