/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigDecimal;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main(String[] args) {
        Integer primeiroTermo = 5;
        Integer segundoTermo = 6;
        Integer terceiroTermo = 7;
        Integer quartoTermo = 8;

        BigDecimal div = new BigDecimal(1d/2d);
		BigDecimal teste = (div.multiply(new BigDecimal(primeiroTermo.doubleValue()))
                    .multiply(new BigDecimal(segundoTermo.doubleValue())).add((div)
                    .multiply(new BigDecimal(terceiroTermo.doubleValue()))
                    .multiply(new BigDecimal(quartoTermo.doubleValue()))));

        System.out.println("Valor total de Bxt em BigDecimal: " + teste);

        Double Bxt =
                (1d/2d) * primeiroTermo.doubleValue() * segundoTermo.doubleValue() + 
                (1d/2d) * terceiroTermo.doubleValue() * quartoTermo.doubleValue();

        System.out.println("Valor de BXT: em Double " + Bxt);
    }
}