PHP 72
Apparently I completely missed the point of this code-golf. I'm STILL not sure if I understand it correctly. Is no output required? Can I assume the methods of g and h? Here's a new version based off the old one:
<?=$f=function($g,$h,$x){return$k=($g[0]*$h[0]*$x)+($g[0]*$h[1])+$g[1];}
If this is still wrong, I give up.
PHP 176
The requirements are kind of confusing, but here's what I think you meant:
<?=f($argv);function f($a){$x=$a[3];$g=explode("x",$a[1]);$h=explode("x",$a[2]);return$k=($g[0]*$h[0])."*$x+".(($g[0]*$h[1])+$g[1])."=".(($g[0]*$h[0]*$x)+($g[0]*$h[1])+$g[1]);}
Usage: php f.php 2x+3 3x+4 5
Output: 6*5+11=41
Another Example
Usage: php f.php 4x-7 3x+4 2
Output: 12*2+9=33
Method
As you described, we can't simply output the answer with g(h(x)), we had to create function f(g,h) which determines what both the functions would be together, and return that as a new function: k(x).
Is this what OP meant?
Ungolfed
<?php
function f($a) {
$x=$a[3];
$g=explode("x",$a[1]);
$h=explode("x",$a[2]);
$k = $g[0]*$h[0];
$k .= "*";
$k .= $x;
$k .= "+";
$k .= ($g[0]*$h[1])+$g[1];
$k .= " = ";
$k .= ($g[0]*$h[0]*$x) + ($g[0]*$h[1])+$g[1];
return $k;
}
echo f($argv);
(a,b)for whichk(x)=ax+b? A function that must be written in the formk(x)=ax+b? If the second, doaandbhave to be given explicit assignments in that function? \$\endgroup\$