What is sulfamethoxazole and trimethoprim (Bactrim, Bactrim DS, Septra, Septra DS, SMZ-TMP DS, Sulfatrim Pediatric)? Sulfamethoxazole and trimethoprim are both antibiotics that treat different types of infection caused by bacteria.