[tex]P=\frac{(a+b)*h}{2} |*2\\2P = (a+b)*h | :h \\\frac{2P}{h} = a + b |-a\\b = \frac{2P}{h} -a = \frac{2P - ah}{h}[/tex]